SIM Block Waveforms

SIM block, simulated again

Behavioural VHDL from SIM23049.VHD, Kongsberg College of Engineering, 23 April 1992, run with its own testbench in GHDL. Stimulus as written in 1992: RTR = 82 (hex 52), TF = 1, TBSY = 16, AE = 1, reset released at 16 ns, ST raised at 50 ns, 38 µs of simulated time.

logic levelvalue of a counter or stateunknown (X)

The whole run

The controller starts once and then repeats by itself because AE is set. Each round is one 6.4 µs STI pulse followed by a 0.4 µs pause. The counter steps 2, 3, 4, 5 and goes back to 2, which are the low and high halves of RTR; ATF is always the counter plus 7. BSY is a 3.2 µs pulse at the start of each round.

0 5 10 15 20 25 30 35 time, µs ST STATE_REG S7 S7 S7 S7 S7 S7 STI NEWTF BSY TFE KOMP CUSTCOUNT 2 3 4 5 2 3 4 ATF 9 10 11 12 9 10 11

Start-up, the first 900 ns

Everything is unknown until the testbench drives its inputs at 2 ns. Reset (MRB low) puts the controller in S0. ST then sends it to S1, where it waits for STI; that comes one CLKSIM period later because TF is 1. It then runs S2, S4, S5, S7: compare, step the counter, wait for STI to fall.

0 100 200 300 400 500 600 700 800 900 time, ns MHZ20 MHZ5 CLKSIM MRB ST STATE_REG S0 S1 S2 S4 S5 S7 PRN PRBN TFE STI NEWTF BSYN BSY RTRH 5 RTRL 2 KOMP CUSTCOUNT X 2 3 ATF X 9 10 STICOUNT X 0 1 0 1 BSYCOUNT X 0 1 2 3 4

Between two rounds, 6.9 to 7.9 µs

STI falls after 16 CLKSIM periods, the controller leaves S7 for S1, and the next round begins. NEWTF is high while the controller waits in S7.

6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 time, ns MHZ20 CLKSIM STATE_REG S7 S1 S2 S4 S5 S7 TFE STI NEWTF PRBN BSY KOMP CUSTCOUNT 3 4 ATF 10 11 STICOUNT 16 0 1 0 1

The wrap-around, 14.1 to 14.6 and 21.0 to 21.5 µs

When the counter reaches 5 it equals the high half of RTR, so KOMP goes high. On the next round the controller takes S6 instead of S5 and reloads the counter with 2.

14100 14150 14200 14250 14300 14350 14400 14450 14500 14550 14600 time, ns MHZ20 STATE_REG S1 S2 S4 S5 S7 STI KOMP CUSTCOUNT 4 5 ATF 11 12
21000 21050 21100 21150 21200 21250 21300 21350 21400 21450 21500 time, ns MHZ20 STATE_REG S1 S2 S4 S6 S7 STI KOMP CUSTCOUNT 5 2 ATF 12 9

What had to change to run it

The 1992 file is untouched; prepare.py makes a working copy with these edits. None of them alters how the block behaves.

3ns → 3 nsToday a space is required between the number and the unit.
NUMBER_TO_FVLAssigned to its own input signal. Now uses a local copy. Not called by SIM.
FVL_TO_NUMBERDeclared to take a signal but was handed a variable in MASK. Not called by SIM.
generic DELThe testbench component had no value for it; given the entity's default of 2 ns.
configurationuse entity SIM(BEHAVE) needs the library name: work.SIM(BEHAVE).
--std=08The block reads its own output STI, which the language only allowed from 2008.
loggerA process added inside the block writes every signal change to a text file, which this page is drawn from.