简体   繁体   中英

Why does this example from the myHDL manual give me different results?

Here is an example that I've copied from the myHDL manual . In my code the generator FSM() never gets invoked so the state is always 'SEARCH'.

I can't figure out why the generator is not getting called.

Edit:

Changing this line from:

reset = ResetSignal(0, active=ACTIVE_LOW, async=True)

to:

reset = ResetSignal(1, active=ACTIVE_LOW, async=True)

I think this is a bug in the example - if reset is ACTIVE_LOW it should be initialized to 1, not 0?

从我的代码跟踪

跟踪工作版本

You need to release the reset signal. This line:

reset = ResetSignal(0, active=ACTIVE_LOW, async=True)

is correct as written in the example. The active low reset is (correctly) low at startup.

The reason you have no activity is that you do not set the reset high (ie inactive) at any point.

Update your stimulus function:

def stimulus():
        for i in range(3):
            yield clk.posedge
        reset.next = 1
        for n in (12, 8, 8, 4):

I would also call the reset signal reset_n to indicate clearly its active low nature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM