PandABlocks / PandABlocks-FPGA

VHDL functional blocks with their simulations and test sequences
Apache License 2.0
20 stars 17 forks source link

Block SEQ: Errors in the sequencer block or in application? #41

Closed jbeca closed 3 years ago

jbeca commented 3 years ago

oscilloscope : show errors in sequence.

scope

descripition:

The enable input Blocks are controled by SRGATE1.

The SRGATE 2 and 3 are controlled by the sequencer.

The connections are: SRGATE2.RST=SEQ1.OUTB SRGATE2.SET=SEQ1.OUTA SRGATE3.RST=SEQ1.OUTD SRGATE3.SET=SEQ1.OUTC

The inputs used for the sequencer are:

The sequencer Table: Table line 1,2,3,4 are the sequence base. This sequence are repeted with the table lines (5,6,7,8) and (9,10,11,12).

Erreurs are in sequence ligne 5,8,9,12. (with regard to the reference sequence, there is or not a signal) (There is no signal generated by SEQ to control the srgate2.) (the expected signal is indicated in gray)

Erreurs : The table line 13 is a test "do nothing" but the outputs change. (SEQ does not generate signals to control the srgate, but the srgate2 ant 3 change state)

panda parameters files:

program.txt table.txt

shu-soleil commented 3 years ago

Jerome, could you try to set the SEQ1.TABLE with phase time > 1 (8ns) on each line ?

thomascobb commented 3 years ago

I've reproduced this, I'll look into it...

shu-soleil commented 3 years ago

I've made some short tests yesterday, it seems the SEQ could miss or jump lines when 'Phase 2 Time'=1 (especially lines behind 'immediate' triggered lines?).

thomascobb commented 3 years ago

Yes, the problem is here: https://github.com/PandABlocks/PandABlocks-FPGA/blob/f5798aff4f9b602c450f98e299a8d088e1f82bbb/modules/seq/hdl/seq.vhd#L276-L280

It looks like the last part of the or tries to pre-load in PHASE1 if PHASE2 is too short, but the conditions aren't restrictive enough. I'll try to find a more general fix.

As a workaround, if you make PHASE2 anything other than 1 clock tick then everything seems to work.

thomascobb commented 3 years ago

Tested on a real PandA and it seems to work, so have merged into master