Avlsi M3
Avlsi M3
SystemVerilog
What is SystemVerilog?
In simulation, the test bench wraps around the DUT , just as a hardware.
Both the test bench and tester provide stimulus and capture responses.
The difference between them is that your test bench needs to work over a
wide range of levels of abstraction.
Test bench Components
What goes into that test bench block? It is made of many bus functional models
(BFM).
If the real device connects to AMBA, USB, PCI, and SPI buses, you have to build
equivalent components in your test bench that can generate stimulus and check the
response.
These are not detailed, synthesizable models but instead, highlevel transactors.
.
Layered Test bench
• A key concept for any modern verification methodology is the layered
Test bench.
• While this process may seem to make the test bench more complex,
it actually helps to make your task easier by dividing the code into
smaller pieces that can be developed separately.
• Don’t try to write a single routine that can randomly generate all types
of stimulus, both legal and illegal,
When you first learned Verilog and started writing tests, they probably
looked like the following low-level code .that does a simplified APB (AMBA
Peripheral Bus) Write
Flat Test bench … Example
Example 1-1 Driving the APB pins
• module test(PAddr, PWrite, PSel, PRData, Rst, clk);
• // Port declarations omitted...
• initial begin
• // Drive reset
• Rst <= 0;
• #100 Rst <= 1;
• // Drive Control bus
• @(posedge clk)
• PAddr <= 16’h50;
• PWData <= 32’h50;
• PWrite <= 1'b1;
• PSel <= 1'b1;
• // Toggle PEnable
• @(posedge clk)
• PEnable <= 1'b1;
• @(posedge clk)
• PEnable <= 1'b0;
• // Check the result
• if (top.mem.memory[16’h50] == 32’h50)
• $display("Success");
• else
• $display("Error, wrong value in memory");
• $finish;
• end
• endmodul
Assertions in System Verilog
• task run();
• done = 0;
• while (!done) begin
• // Get the next transaction
• // Make transformations
• // Send out transactions
• end
• endtask
Simulation Environment Phases
• until now we have been learning what parts make up the
environment.