SV test bench for APB protocol ram (single slave configuration).
-
Download the latest release from below or visit the release page for more old release.
-
Copy the contents in a folder.
-
Compile tb_top.sv in any simulator and simulate top module.
Signals encapsulated in transaction class is shown below:
class transaction;
// Input
rand bit PWRITE;
rand bit[31:0] PWDATA [];
rand bit[31:0] PADDR [];
rand bit PRESETn;
bit PSEL1;
bit PENABLE;
// Output
bit PREADY;
bit [31:0] PRDATA [int];
bit PSLVERR;
endclass
Transaction class also encapsulates helper function like printf(string message)
, compare(transaction trans)
, etc.
Generates new packet which is sent to the driver. Main functionality is to randomize transaction class.
task run();
assert(trans.randomize());
endtask
Drives the packet according to the APB protocol. The drive seqeunce is as follows:
Monitors the input signals of the APB protocol and when a complete transaction is monitored, it sends the sampled packet to reference model, which generates the expected value.
Monitors the output signals of the APB protocol and after complete transaction is monitored it sends the packet to scoreboard for checking.
Generates the reference output/value, which is compared with the actual output received from the DUT
Compares the actual packet and the reference packet and generates report for all the test cases.
This project is governed by MIT License