Skip to content

Commit 1a65bfb

Browse files
committed
mend simulation not advanced exception in ram display
1 parent e7b826e commit 1a65bfb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Renderer/UI/WaveSim/WaveSim.fs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,9 @@ let ramTable (wsModel: WaveSimModel) ((ramId, ramLabel): FComponentId * string)
533533
let fs = wsModel.FastSim
534534
let fc = wsModel.FastSim.FComps[ramId]
535535
let step = wsModel.CurrClkCycle
536+
FastRun.runFastSimulation None step fs |> ignore // not sure why this is needed
537+
538+
// in some cases fast sim is run for one cycle less than currClockCycle
536539
let memData =
537540
match fc.FType with
538541
| ROM1 mem
@@ -541,7 +544,8 @@ let ramTable (wsModel: WaveSimModel) ((ramId, ramLabel): FComponentId * string)
541544
| AsyncRAM1 mem ->
542545
match FastRun.extractFastSimulationState fs wsModel.CurrClkCycle ramId with
543546
|RamState mem -> mem
544-
| _ -> failwithf $"What? Can't find state from RAM component '{ramLabel}'"
547+
| x -> failwithf $"What? Unexpected state {x} from cycle {wsModel.CurrClkCycle} \
548+
in RAM component '{ramLabel}'. FastSim step = {fs.ClockTick}"
545549
| _ -> failwithf $"Given a component {fc.FType} which is not a vaild RAM"
546550
let aWidth,dWidth = memData.AddressWidth,memData.WordWidth
547551

0 commit comments

Comments
 (0)