Logictools generators fail when run

PYNQ-Z1 Board with v3.0.1 from downloaded image.

When running the fsm_generator.ipynb and pattern_generator_and_trace_analyzer.ipynb, the captured waveforms are incorrect when calling the run method. For FSM, the state machine advances twice per clock cycle, but works properly when stepped through the logictools_controller (see below incorrect output, when the commented code is run instead, output is correct). Similarly, the pattern generator loopback signals are all 0 when run, but work fine when stepped.

I haven’t been able to determine if this is an issue with my specific board (no spare boards to test), or whether this is an issue with the software/overlay within PYNQ, so any insight would be helpful.

After digging into the code a bit, it looks like the only difference between a run and a step is the command being written to the MicroBlaze. From pynq.lib.logictools.fsm_generator.py:

def run(self):
...
cmd_run = CMD_RUN | FSM_ENGINE_BIT
        if self.analyzer is not None:
            cmd_run |= TRACE_ENGINE_BIT
        self.logictools_controller.write_command(cmd_run)
...

vs

...
def step(self):
cmd_step = CMD_STEP | FSM_ENGINE_BIT
            if self.analyzer is not None:
                cmd_step |= TRACE_ENGINE_BIT
            self.logictools_controller.write_command(cmd_step)
...

which leads me to believe that this might be an issue with the overlay itself, but without access to the detailed design of the overlay I don’t think I can verify this.

Hi @gweesip,

Welcome to the PYNQ community.

You can find and rebuild the loogictools overlay from here PYNQ/boards/Pynq-Z1/logictools at master · Xilinx/PYNQ · GitHub

Mario

Thanks. I’m not quite at the point of building overlays for PYNQ, but I’ll definitely give that a try when I get there. If I get to the root cause before anyone else chimes in here, I’ll be sure to update.

Hi @gweesip ,
have you found a solution? I have the same problem on pynq-z2 with v3.0.1 image

@hasan.ibhasan Unfortunately, I haven’t been able to test whether rebuilding the overlay myself fixes the issue. The fact that you are having the same issue on the Z2 board as well seems to suggest that this is a bug in the image/overlay itself and maybe worth reporting as such on the Github repo and hopefully fixed in the next update.

          I don't believe there are any then create custom blocks or anything like that but you can create ores with blocks ingame already using this