1

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?

trace from my code

trace for working version

rupello
  • 8,361
  • 2
  • 37
  • 34
  • Sounds like you haven't quite copied the code accurately - can you get a simpler system to work? Or post the code you are using? – Martin Thompson Oct 19 '13 at 15:33
  • my code is pasted in the link - I added some more info after getting it working by modifying the reset signal – rupello Oct 19 '13 at 17:04

1 Answers1

1

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.

Martin Thompson
  • 16,395
  • 1
  • 38
  • 56