upd: reflectometer on axis bus iface + TB
This commit is contained in:
53
designs/reflectometer_base/interfaces.svh
Normal file
53
designs/reflectometer_base/interfaces.svh
Normal file
@ -0,0 +1,53 @@
|
||||
`ifndef AXIS_INTERFACE_SVH
|
||||
`define AXIS_INTERFACE_SVH
|
||||
|
||||
interface axis_if #(
|
||||
parameter int DATA_WIDTH = 8
|
||||
)(
|
||||
input logic clk,
|
||||
input logic rst_n
|
||||
);
|
||||
|
||||
// Сигналы шины AXI-Stream
|
||||
logic [DATA_WIDTH-1:0] tdata;
|
||||
logic tvalid;
|
||||
logic tlast;
|
||||
logic tready;
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Clocking block для Testbench (Driver/Monitor)
|
||||
// Защищает от Race Conditions в симуляции
|
||||
//------------------------------------------------------------
|
||||
clocking drv_cb @(posedge clk);
|
||||
default input #1step output #100ps;
|
||||
output tdata, tvalid, tlast;
|
||||
input tready;
|
||||
endclocking
|
||||
|
||||
clocking mon_cb @(posedge clk);
|
||||
default input #1step;
|
||||
input tdata, tvalid, tlast, tready;
|
||||
endclocking
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Modports для автоматического подключения одной строчкой
|
||||
//------------------------------------------------------------
|
||||
modport master (
|
||||
output tdata, tvalid, tlast,
|
||||
input tready
|
||||
);
|
||||
|
||||
modport slave (
|
||||
input tdata, tvalid, tlast,
|
||||
output tready
|
||||
);
|
||||
|
||||
// Modport для тестбенча (чтобы работать через функции)
|
||||
modport tb (
|
||||
clocking drv_cb,
|
||||
clocking mon_cb
|
||||
);
|
||||
|
||||
endinterface
|
||||
|
||||
`endif // AXIS_INTERFACE_SVH
|
||||
Reference in New Issue
Block a user