On 7/2/14 4:18 PM, Colin Beighley wrote:
> Hello,
>
> I'm wondering what the best way of doing a synchronous set in MyHDL is.
> Since there doesn't seem to be a built-in equivalent of
> @always_seq(clk.posedge, rst) for synchronous sets, is the following
> best practice? Let me know if it's bad practice to embed html.
>
> def qff_w_set(clk, set, q0, q, d):
>
> @always_seq(clk.posedge)
> def logic():
> if set:
> q.next= q0
> else:
> q.next= d
>
> return logic
>
> Thanks,
> Colin
>
>
Yes, that is a reasonable approach.
Regards,
Chris
|