3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-11-01 21:37:52 +00:00

Add docs/examples/abstract

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2019-03-27 14:45:30 +01:00
parent f918e2369a
commit afe6960ffe
6 changed files with 124 additions and 0 deletions

View file

@ -0,0 +1,19 @@
module demo_counter_abstr (
input clock, reset,
input [19:0] counter
);
default clocking @(posedge clock); endclocking
default disable iff (reset);
// make sure the counter doesnt jump over all "magic values"
`demo_counter_abstr_mode property ((counter < 123456) |=> (counter <= 123456));
`demo_counter_abstr_mode property ((counter < 234567) |=> (counter <= 234567));
`demo_counter_abstr_mode property ((counter < 345678) |=> (counter <= 345678));
`demo_counter_abstr_mode property ((counter < 456789) |=> (counter <= 456789));
// only allow overflow by visiting the max value
`demo_counter_abstr_mode property (counter != 20'hfffff |=> $past(counter) < counter);
`demo_counter_abstr_mode property (counter == 20'hfffff |=> !counter);
endmodule
bind demo demo_counter_abstr demo_counter_abstr_i (.*);