actlib_dataflow_neuro/test/unit_tests/flipflop/test.prsim

51 lines
511 B
Plaintext
Raw Normal View History

2022-03-04 21:12:52 +01:00
watchall
system "echo '[0] start test'"
2022-03-30 15:01:50 +02:00
2022-03-07 16:36:01 +01:00
set Reset 0
2022-03-04 21:12:52 +01:00
set t.d 0
2022-03-30 16:03:01 +02:00
set t.clk 0
cycle
status X
mode run
2022-03-04 21:12:52 +01:00
assert t.q 0
2022-03-07 16:36:01 +01:00
system "echo '[1] reset completed'"
2022-03-30 15:01:50 +02:00
system "echo '[2] tested d = 0, clk rise'"
2022-03-30 16:03:01 +02:00
set t.clk 1
2022-03-30 15:01:50 +02:00
set t.d 1
cycle
2022-03-30 16:03:01 +02:00
set t.clk 0
cycle
2022-03-30 15:01:50 +02:00
set t.d 0
cycle
assert t.q 1
2022-03-30 16:03:01 +02:00
set t.clk 1
2022-03-30 15:01:50 +02:00
cycle
assert t.q 0
2022-03-30 15:01:50 +02:00
set t.d 0
2022-03-04 21:12:52 +01:00
set t.clk 0
cycle
2022-03-30 15:01:50 +02:00
assert t.q 0
2022-03-04 21:12:52 +01:00
set t.d 1
cycle
2022-03-30 16:03:01 +02:00
set t.clk 0
cycle
2022-03-04 21:12:52 +01:00
assert t.q 0
2022-03-30 15:01:50 +02:00
system "echo '[3] tested d = 1, clk rise and fall'"
set t.d 1
cycle
2022-03-30 16:03:01 +02:00
set t.clk 1
2022-03-04 21:12:52 +01:00
cycle
2022-03-30 15:01:50 +02:00
set t.d 0
cycle
assert t.q 1