4 ; This example demonstrates a simple blocking assignment to a
5 ; reg vector within a module.
9 main .scope module, "main" "main";
11 ; This declares a "reg" data type named "test" in the current scope.
12 ; The bit range is given for the purposes of VPI access. The range
13 ; corresponds to the declaration "reg [7:0] test", so leads to an 8
15 test .var "test", 7, 0;
17 ; The %assign/v0 opcode assigns a vector to the .var at the label,
18 ; with the given delay. The width of the vector from index register0.
20 T0 %ix/load 0, 8 ; Set the width of the vector to 8.
22 %assign/v0 test, 2, 0 ;
24 %vpi_call "$display", "test = %b", test;
26 %assign/v0 test, 2, 1 ;
28 %vpi_call "$display", "test = %b", test;
30 %vpi_call "$display", "test = %b", test;
32 %assign/v0 test, 2, 2 ;
34 %vpi_call "$display", "test = %b", test;
36 %assign/v0 test, 2, 3 ;
38 %vpi_call "$display", "test = %b", test;