pulp-platform / snitch_cluster

An energy-efficient RISC-V floating-point compute cluster.
https://pulp-platform.github.io/snitch_cluster/
Apache License 2.0
51 stars 53 forks source link

Instruction Interface not stable assertion failed #11

Open huettern opened 3 years ago

huettern commented 3 years ago

After the change of @SamuelRiedel in pulp-platform/snitch#69, i get assertion failures:

# ** Error: [ASSERT FAILED] [tb_bin.i_dut.i_snitch_cluster.i_cluster.gen_core[8].i_snitch_cc.i_snitch.InstructionInterfaceStable] InstructionInterfaceStable (/home/noah/git/snitch-dace/snitch/hw/ip/snitch/src/snitch.sv:2599)
#    Time: 350 ns Started: 349 ns  Scope: tb_bin.i_dut.i_snitch_cluster.i_cluster.gen_core[8].i_snitch_cc.i_snitch.InstructionInterfaceStable File: /home/noah/git/snitch-dace/snitch/hw/ip/snitch/src/snitch.sv Line: 2599
# ** Error: [ASSERT FAILED] [tb_bin.i_dut.i_snitch_cluster.i_cluster.gen_core[0].i_snitch_cc.i_snitch.InstructionInterfaceStable] InstructionInterfaceStable (/home/noah/git/snitch-dace/snitch/hw/ip/snitch/src/snitch.sv:2599)
#    Time: 361 ns Started: 360 ns  Scope: tb_bin.i_dut.i_snitch_cluster.i_cluster.gen_core[0].i_snitch_cc.i_snitch.InstructionInterfaceStable File: /home/noah/git/snitch-dace/snitch/hw/ip/snitch/src/snitch.sv Line: 2599
# ** Error: [ASSERT FAILED] [tb_bin.i_dut.i_snitch_cluster.i_cluster.gen_core[4].i_snitch_cc.i_snitch.InstructionInterfaceStable] InstructionInterfaceStable (/home/noah/git/snitch-dace/snitch/hw/ip/snitch/src/snitch.sv:2599)
#    Time: 418 ns Started: 417 ns  Scope: tb_bin.i_dut.i_snitch_cluster.i_cluster.gen_core[4].i_snitch_cc.i_snitch.InstructionInterfaceStable File: /home/noah/git/snitch-dace/snitch/hw/ip/snitch/src/snitch.sv Line: 2599

Can you reproduce this using the attached binary? Is it a concern?

ssr_intrinsic.tar.gz

zarubaf commented 3 years ago

Thanks for the issue. I'll try digging into it over the weekend. The assertion shouldn't trigger, maybe we need to re-investigate the pre-fetching policy a bit further. I'll keep you posted.

SamuelRiedel commented 3 years ago

Thanks Noah for the report and for including a binary. I looked into it and as far as I understand, the problem is that the instructions triggering these assertions come from the bootrom, which is set to be non-cacheable. They bypass the cache and the ready signal is only asserted for one cycle while Snitch has to wait for an outstanding load.

So either we change the assertion to not check non-cacheable instructions, but then we have no guarantee that they will always be stable. Or we change the bypass logic to keep the ready and the instruction stable.

zarubaf commented 3 years ago

Of course @SamuelRiedel is right! At first glance it seems that this is actually a bit more problematic to handle than I would wish for.

What's your take on this @noah95 @SamuelRiedel?

SamuelRiedel commented 3 years ago
huettern commented 3 years ago

Thank you for investigating this. Since I'm not familiar with the instruction fetch and cache at all I can't contribute to the discussion, sorry. But let me know if I can help testing any fixes.