Skip to content

Commit

Permalink
scoreboard: Updated after sequencer changes
Browse files Browse the repository at this point in the history
Signed-off-by: Istvan-Zsolt Szekely <[email protected]>
  • Loading branch information
IstvanZsSzekely committed Mar 6, 2024
1 parent 21daab3 commit f2ea2cd
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 90 deletions.
3 changes: 2 additions & 1 deletion common/sv/x_monitor.sv
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ package x_monitor_pkg;
this.get_key();
if (this.axi_ap.get_item_cnt() > 0) begin
this.axi_ap.get(transaction);
`INFO(("Transaction pulled"));
if (bit'(transaction.get_cmd_type()) == bit'(operation_type)) begin
this.put_key();
num_bytes = transaction.get_data_width()/8;
Expand All @@ -131,11 +132,11 @@ package x_monitor_pkg;
this.axi_byte_stream_size = 0;
end
end else begin
this.axi_ap.write(transaction);
this.put_key();
#1step;
end
end else begin
this.axi_ap.write(transaction);
this.put_key();
#1step;
end
Expand Down
132 changes: 65 additions & 67 deletions scoreboard/environment.sv
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ package environment_pkg;
import `PKGIFY(test_harness, adc_dst_axi_pt_0)::*;
import `PKGIFY(test_harness, dac_src_axi_pt_0)::*;

import `PKGIFY(test_harness, adc_src_axis_1)::*;
import `PKGIFY(test_harness, dac_dst_axis_1)::*;
import `PKGIFY(test_harness, adc_dst_axi_pt_1)::*;
import `PKGIFY(test_harness, dac_src_axi_pt_1)::*;
// import `PKGIFY(test_harness, adc_src_axis_1)::*;
// import `PKGIFY(test_harness, dac_dst_axis_1)::*;
// import `PKGIFY(test_harness, adc_dst_axi_pt_1)::*;
// import `PKGIFY(test_harness, dac_src_axi_pt_1)::*;

class environment extends test_harness_env;

Expand All @@ -35,10 +35,10 @@ package environment_pkg;
`AGENT(test_harness, adc_dst_axi_pt_0, passthrough_mem_t) adc_dst_axi_pt_agent_0;
`AGENT(test_harness, dac_src_axi_pt_0, passthrough_mem_t) dac_src_axi_pt_agent_0;

`AGENT(test_harness, adc_src_axis_1, mst_t) adc_src_axis_agent_1;
`AGENT(test_harness, dac_dst_axis_1, slv_t) dac_dst_axis_agent_1;
`AGENT(test_harness, adc_dst_axi_pt_1, passthrough_mem_t) adc_dst_axi_pt_agent_1;
`AGENT(test_harness, dac_src_axi_pt_1, passthrough_mem_t) dac_src_axi_pt_agent_1;
// `AGENT(test_harness, adc_src_axis_1, mst_t) adc_src_axis_agent_1;
// `AGENT(test_harness, dac_dst_axis_1, slv_t) dac_dst_axis_agent_1;
// `AGENT(test_harness, adc_dst_axi_pt_1, passthrough_mem_t) adc_dst_axi_pt_agent_1;
// `AGENT(test_harness, dac_src_axi_pt_1, passthrough_mem_t) dac_src_axi_pt_agent_1;

m_axis_sequencer #(`AGENT(test_harness, adc_src_axis_0, mst_t),
`AXIS_VIP_PARAMS(test_harness, adc_src_axis_0)
Expand All @@ -47,27 +47,27 @@ package environment_pkg;
s_axi_sequencer #(`AGENT(test_harness, adc_dst_axi_pt_0, passthrough_mem_t)) adc_dst_axi_pt_seq_0;
s_axi_sequencer #(`AGENT(test_harness, dac_src_axi_pt_0, passthrough_mem_t)) dac_src_axi_pt_seq_0;

m_axis_sequencer #(`AGENT(test_harness, adc_src_axis_1, mst_t),
`AXIS_VIP_PARAMS(test_harness, adc_src_axis_1)
) adc_src_axis_seq_1;
s_axis_sequencer #(`AGENT(test_harness, dac_dst_axis_1, slv_t)) dac_dst_axis_seq_1;
s_axi_sequencer #(`AGENT(test_harness, adc_dst_axi_pt_1, passthrough_mem_t)) adc_dst_axi_pt_seq_1;
s_axi_sequencer #(`AGENT(test_harness, dac_src_axi_pt_1, passthrough_mem_t)) dac_src_axi_pt_seq_1;
// m_axis_sequencer #(`AGENT(test_harness, adc_src_axis_1, mst_t),
// `AXIS_VIP_PARAMS(test_harness, adc_src_axis_1)
// ) adc_src_axis_seq_1;
// s_axis_sequencer #(`AGENT(test_harness, dac_dst_axis_1, slv_t)) dac_dst_axis_seq_1;
// s_axi_sequencer #(`AGENT(test_harness, adc_dst_axi_pt_1, passthrough_mem_t)) adc_dst_axi_pt_seq_1;
// s_axi_sequencer #(`AGENT(test_harness, dac_src_axi_pt_1, passthrough_mem_t)) dac_src_axi_pt_seq_1;

x_axis_monitor #(`AGENT(test_harness, adc_src_axis_0, mst_t)) adc_src_axis_0_mon;
x_axis_monitor #(`AGENT(test_harness, dac_dst_axis_0, slv_t)) dac_dst_axis_0_mon;
x_axi_monitor #(`AGENT(test_harness, adc_dst_axi_pt_0, passthrough_mem_t), WRITE_OP) adc_dst_axi_pt_0_mon;
x_axi_monitor #(`AGENT(test_harness, dac_src_axi_pt_0, passthrough_mem_t), READ_OP) dac_src_axi_pt_0_mon;

x_axis_monitor #(`AGENT(test_harness, adc_src_axis_1, mst_t)) adc_src_axis_1_mon;
x_axis_monitor #(`AGENT(test_harness, dac_dst_axis_1, slv_t)) dac_dst_axis_1_mon;
x_axi_monitor #(`AGENT(test_harness, adc_dst_axi_pt_1, passthrough_mem_t), WRITE_OP) adc_dst_axi_pt_1_mon;
x_axi_monitor #(`AGENT(test_harness, dac_src_axi_pt_1, passthrough_mem_t), READ_OP) dac_src_axi_pt_1_mon;
// x_axis_monitor #(`AGENT(test_harness, adc_src_axis_1, mst_t)) adc_src_axis_1_mon;
// x_axis_monitor #(`AGENT(test_harness, dac_dst_axis_1, slv_t)) dac_dst_axis_1_mon;
// x_axi_monitor #(`AGENT(test_harness, adc_dst_axi_pt_1, passthrough_mem_t), WRITE_OP) adc_dst_axi_pt_1_mon;
// x_axi_monitor #(`AGENT(test_harness, dac_src_axi_pt_1, passthrough_mem_t), READ_OP) dac_src_axi_pt_1_mon;

scoreboard scoreboard_tx0;
scoreboard scoreboard_rx0;
scoreboard scoreboard_tx1;
scoreboard scoreboard_rx1;
// scoreboard scoreboard_tx1;
// scoreboard scoreboard_rx1;

//============================================================================
// Constructor
Expand All @@ -85,12 +85,12 @@ package environment_pkg;
virtual interface axi4stream_vip_if #(`AXIS_VIP_IF_PARAMS(test_harness, adc_src_axis_0)) adc_src_axis_vip_if_0,
virtual interface axi4stream_vip_if #(`AXIS_VIP_IF_PARAMS(test_harness, dac_dst_axis_0)) dac_dst_axis_vip_if_0,
virtual interface axi_vip_if #(`AXI_VIP_IF_PARAMS(test_harness, adc_dst_axi_pt_0)) adc_dst_axi_pt_vip_if_0,
virtual interface axi_vip_if #(`AXI_VIP_IF_PARAMS(test_harness, dac_src_axi_pt_0)) dac_src_axi_pt_vip_if_0,
virtual interface axi_vip_if #(`AXI_VIP_IF_PARAMS(test_harness, dac_src_axi_pt_0)) dac_src_axi_pt_vip_if_0

virtual interface axi4stream_vip_if #(`AXIS_VIP_IF_PARAMS(test_harness, adc_src_axis_1)) adc_src_axis_vip_if_1,
virtual interface axi4stream_vip_if #(`AXIS_VIP_IF_PARAMS(test_harness, dac_dst_axis_1)) dac_dst_axis_vip_if_1,
virtual interface axi_vip_if #(`AXI_VIP_IF_PARAMS(test_harness, adc_dst_axi_pt_1)) adc_dst_axi_pt_vip_if_1,
virtual interface axi_vip_if #(`AXI_VIP_IF_PARAMS(test_harness, dac_src_axi_pt_1)) dac_src_axi_pt_vip_if_1
// virtual interface axi4stream_vip_if #(`AXIS_VIP_IF_PARAMS(test_harness, adc_src_axis_1)) adc_src_axis_vip_if_1,
// virtual interface axi4stream_vip_if #(`AXIS_VIP_IF_PARAMS(test_harness, dac_dst_axis_1)) dac_dst_axis_vip_if_1,
// virtual interface axi_vip_if #(`AXI_VIP_IF_PARAMS(test_harness, adc_dst_axi_pt_1)) adc_dst_axi_pt_vip_if_1,
// virtual interface axi_vip_if #(`AXI_VIP_IF_PARAMS(test_harness, dac_src_axi_pt_1)) dac_src_axi_pt_vip_if_1

);

Expand All @@ -107,35 +107,35 @@ package environment_pkg;
adc_dst_axi_pt_agent_0 = new("ADC Destination AXI Agent 0", adc_dst_axi_pt_vip_if_0);
dac_src_axi_pt_agent_0 = new("DAC Source AXI Agent 0", dac_src_axi_pt_vip_if_0);

adc_src_axis_agent_1 = new("ADC Source AXI Stream Agent 1", adc_src_axis_vip_if_1);
dac_dst_axis_agent_1 = new("DAC Destination AXI Stream Agent 1", dac_dst_axis_vip_if_1);
adc_dst_axi_pt_agent_1 = new("ADC Destination AXI Agent 1", adc_dst_axi_pt_vip_if_1);
dac_src_axi_pt_agent_1 = new("DAC Source AXI Agent 1", dac_src_axi_pt_vip_if_1);
// adc_src_axis_agent_1 = new("ADC Source AXI Stream Agent 1", adc_src_axis_vip_if_1);
// dac_dst_axis_agent_1 = new("DAC Destination AXI Stream Agent 1", dac_dst_axis_vip_if_1);
// adc_dst_axi_pt_agent_1 = new("ADC Destination AXI Agent 1", adc_dst_axi_pt_vip_if_1);
// dac_src_axi_pt_agent_1 = new("DAC Source AXI Agent 1", dac_src_axi_pt_vip_if_1);

adc_src_axis_seq_0 = new(adc_src_axis_agent_0);
dac_dst_axis_seq_0 = new(dac_dst_axis_agent_0);
adc_dst_axi_pt_seq_0 = new(adc_dst_axi_pt_agent_0);
dac_src_axi_pt_seq_0 = new(dac_src_axi_pt_agent_0);

adc_src_axis_seq_1 = new(adc_src_axis_agent_1);
dac_dst_axis_seq_1 = new(dac_dst_axis_agent_1);
adc_dst_axi_pt_seq_1 = new(adc_dst_axi_pt_agent_1);
dac_src_axi_pt_seq_1 = new(dac_src_axi_pt_agent_1);
// adc_src_axis_seq_1 = new(adc_src_axis_agent_1);
// dac_dst_axis_seq_1 = new(dac_dst_axis_agent_1);
// adc_dst_axi_pt_seq_1 = new(adc_dst_axi_pt_agent_1);
// dac_src_axi_pt_seq_1 = new(dac_src_axi_pt_agent_1);

adc_src_axis_0_mon = new("ADC Source AXIS 0 Transaction Monitor", adc_src_axis_agent_0);
dac_dst_axis_0_mon = new("DAC Destination AXIS 0 Transaction Monitor", dac_dst_axis_agent_0);
adc_dst_axi_pt_0_mon = new("ADC Destination AXI 0 Transaction Monitor", adc_dst_axi_pt_agent_0);
dac_src_axi_pt_0_mon = new("DAC Source AXI 0 Transaction Monitor", dac_src_axi_pt_agent_0);

adc_src_axis_1_mon = new("ADC Source AXIS 1 Transaction Monitor", adc_src_axis_agent_1);
dac_dst_axis_1_mon = new("DAC Destination AXIS 1 Transaction Monitor", dac_dst_axis_agent_1);
adc_dst_axi_pt_1_mon = new("ADC Destination AXI 1 Transaction Monitor", adc_dst_axi_pt_agent_1);
dac_src_axi_pt_1_mon = new("DAC Source AXI 1 Transaction Monitor", dac_src_axi_pt_agent_1);
// adc_src_axis_1_mon = new("ADC Source AXIS 1 Transaction Monitor", adc_src_axis_agent_1);
// dac_dst_axis_1_mon = new("DAC Destination AXIS 1 Transaction Monitor", dac_dst_axis_agent_1);
// adc_dst_axi_pt_1_mon = new("ADC Destination AXI 1 Transaction Monitor", adc_dst_axi_pt_agent_1);
// dac_src_axi_pt_1_mon = new("DAC Source AXI 1 Transaction Monitor", dac_src_axi_pt_agent_1);

scoreboard_tx0 = new("Data Offload Verification Environment TX 0 Scoreboard");
scoreboard_rx0 = new("Data Offload Verification Environment RX 0 Scoreboard");
scoreboard_tx1 = new("Data Offload Verification Environment TX 1 Scoreboard");
scoreboard_rx1 = new("Data Offload Verification Environment RX 1 Scoreboard");
// scoreboard_tx1 = new("Data Offload Verification Environment TX 1 Scoreboard");
// scoreboard_rx1 = new("Data Offload Verification Environment RX 1 Scoreboard");

endfunction

Expand All @@ -146,20 +146,18 @@ package environment_pkg;
task configure(int bytes_to_generate);

// ADC stub
adc_src_axis_seq_0.set_data_gen_mode(1);
adc_src_axis_seq_0.set_rand_valid(0);
adc_src_axis_seq_0.set_data_gen_mode(DATA_GEN_MODE_AUTO_INCR);
adc_src_axis_seq_0.add_xfer_descriptor(bytes_to_generate, 0, 0);

// DAC stub
dac_dst_axis_seq_0.set_mode(XIL_AXI4STREAM_READY_GEN_NO_BACKPRESSURE);

// ADC stub
adc_src_axis_seq_1.set_data_gen_mode(1);
adc_src_axis_seq_1.set_rand_valid(0);
adc_src_axis_seq_1.add_xfer_descriptor(bytes_to_generate, 0, 0);
// // ADC stub
// adc_src_axis_seq_1.set_data_gen_mode(DATA_GEN_MODE_AUTO_INCR);
// adc_src_axis_seq_1.add_xfer_descriptor(bytes_to_generate, 0, 0);

// DAC stub
dac_dst_axis_seq_1.set_mode(XIL_AXI4STREAM_READY_GEN_NO_BACKPRESSURE);
// // DAC stub
// dac_dst_axis_seq_1.set_mode(XIL_AXI4STREAM_READY_GEN_NO_BACKPRESSURE);

endtask

Expand All @@ -177,25 +175,25 @@ package environment_pkg;
adc_dst_axi_pt_agent_0.start_monitor();
dac_src_axi_pt_agent_0.start_monitor();

adc_src_axis_agent_1.start_master();
dac_dst_axis_agent_1.start_slave();
adc_dst_axi_pt_agent_1.start_monitor();
dac_src_axi_pt_agent_1.start_monitor();
// adc_src_axis_agent_1.start_master();
// dac_dst_axis_agent_1.start_slave();
// adc_dst_axi_pt_agent_1.start_monitor();
// dac_src_axi_pt_agent_1.start_monitor();

adc_src_axis_seq_0.start();
adc_src_axis_seq_1.start();
// adc_src_axis_seq_1.start();

scoreboard_tx0.set_source_stream(dac_src_axi_pt_0_mon);
scoreboard_tx0.set_sink_stream(dac_dst_axis_0_mon);

scoreboard_rx0.set_source_stream(adc_src_axis_0_mon);
scoreboard_rx0.set_sink_stream(adc_dst_axi_pt_0_mon);

scoreboard_tx1.set_source_stream(dac_src_axi_pt_1_mon);
scoreboard_tx1.set_sink_stream(dac_dst_axis_1_mon);
// scoreboard_tx1.set_source_stream(dac_src_axi_pt_1_mon);
// scoreboard_tx1.set_sink_stream(dac_dst_axis_1_mon);

scoreboard_rx1.set_source_stream(adc_src_axis_1_mon);
scoreboard_rx1.set_sink_stream(adc_dst_axi_pt_1_mon);
// scoreboard_rx1.set_source_stream(adc_src_axis_1_mon);
// scoreboard_rx1.set_sink_stream(adc_dst_axi_pt_1_mon);

endtask

Expand All @@ -212,24 +210,24 @@ package environment_pkg;
adc_src_axis_seq_0.run();
dac_dst_axis_seq_0.run();

adc_src_axis_seq_1.run();
dac_dst_axis_seq_1.run();
// adc_src_axis_seq_1.run();
// dac_dst_axis_seq_1.run();

adc_src_axis_0_mon.run();
dac_dst_axis_0_mon.run();
adc_dst_axi_pt_0_mon.run();
dac_src_axi_pt_0_mon.run();

adc_src_axis_1_mon.run();
dac_dst_axis_1_mon.run();
adc_dst_axi_pt_1_mon.run();
dac_src_axi_pt_1_mon.run();
// adc_src_axis_1_mon.run();
// dac_dst_axis_1_mon.run();
// adc_dst_axi_pt_1_mon.run();
// dac_src_axi_pt_1_mon.run();

scoreboard_tx0.run();
scoreboard_rx0.run();

scoreboard_tx1.run();
scoreboard_rx1.run();
// scoreboard_tx1.run();
// scoreboard_rx1.run();
join_none

endtask
Expand Down Expand Up @@ -263,9 +261,9 @@ package environment_pkg;
adc_src_axis_agent_0.stop_master();
dac_dst_axis_agent_0.stop_slave();

adc_src_axis_seq_1.stop();
adc_src_axis_agent_1.stop_master();
dac_dst_axis_agent_1.stop_slave();
// adc_src_axis_seq_1.stop();
// adc_src_axis_agent_1.stop_master();
// dac_dst_axis_agent_1.stop_slave();

post_test();

Expand Down
2 changes: 1 addition & 1 deletion scoreboard/system_bd.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ad_ip_instance xlconstant GND [list \
]
ad_connect gnd GND/dout

for {set i 0} {$i < 2} {incr i} {
for {set i 0} {$i < 1} {incr i} {
ad_ip_instance axi_dmac i_rx_dmac_${i} [list \
DMA_TYPE_SRC 1 \
DMA_TYPE_DEST 0 \
Expand Down
42 changes: 21 additions & 21 deletions scoreboard/tests/test_program.sv
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ program test_program;
`TH.`ADC_SRC_AXIS_0.inst.IF,
`TH.`DAC_DST_AXIS_0.inst.IF,
`TH.`ADC_DST_AXI_PT_0.inst.IF,
`TH.`DAC_SRC_AXI_PT_0.inst.IF,
`TH.`DAC_SRC_AXI_PT_0.inst.IF

`TH.`ADC_SRC_AXIS_1.inst.IF,
`TH.`DAC_DST_AXIS_1.inst.IF,
`TH.`ADC_DST_AXI_PT_1.inst.IF,
`TH.`DAC_SRC_AXI_PT_1.inst.IF
// `TH.`ADC_SRC_AXIS_1.inst.IF,
// `TH.`DAC_DST_AXIS_1.inst.IF,
// `TH.`ADC_DST_AXI_PT_1.inst.IF,
// `TH.`DAC_SRC_AXI_PT_1.inst.IF
);

dmac_tx_0 = new("DMAC TX 0", env.mng, `TX_DMA_BA_0);
dmac_rx_0 = new("DMAC RX 0", env.mng, `RX_DMA_BA_0);
dmac_tx_1 = new("DMAC TX 1", env.mng, `TX_DMA_BA_1);
dmac_rx_1 = new("DMAC RX 1", env.mng, `RX_DMA_BA_1);
// dmac_tx_1 = new("DMAC TX 1", env.mng, `TX_DMA_BA_1);
// dmac_rx_1 = new("DMAC RX 1", env.mng, `RX_DMA_BA_1);

do_tx_0 = new("Data Offload TX 0", env.mng, `TX_DOFF_BA_0);
do_rx_0 = new("Data Offload RX 0", env.mng, `RX_DOFF_BA_0);
do_tx_1 = new("Data Offload TX 1", env.mng, `TX_DOFF_BA_1);
do_rx_1 = new("Data Offload RX 1", env.mng, `RX_DOFF_BA_1);
// do_tx_1 = new("Data Offload TX 1", env.mng, `TX_DOFF_BA_1);
// do_rx_1 = new("Data Offload RX 1", env.mng, `RX_DOFF_BA_1);

#1step;

Expand Down Expand Up @@ -122,15 +122,15 @@ program test_program;
#100
`INFO(("Start RX DMA ..."));
rx_dma_transfer(dmac_rx_0, 32'h80000000, `ADC_TRANSFER_LENGTH);
rx_dma_transfer(dmac_rx_1, 32'h80000000, `ADC_TRANSFER_LENGTH);
// rx_dma_transfer(dmac_rx_1, 32'h80000000, `ADC_TRANSFER_LENGTH);

#10000
`INFO(("Initialize the memory ..."));
init_mem_64(32'h80000000, 1024);

`INFO(("Start TX DMA ..."));
tx_dma_transfer(dmac_tx_0, 32'h80000000, 1024);
tx_dma_transfer(dmac_tx_1, 32'h80000000, 1024);
// tx_dma_transfer(dmac_tx_1, 32'h80000000, 1024);

#10000;

Expand All @@ -150,15 +150,15 @@ program test_program;
`INFO(("Bring up TX Data Offload 0"));
do_tx_0.deassert_reset();

`INFO(("Bring up RX Data Offload 1"));
do_rx_1.deassert_reset();
`INFO(("Bring up TX Data Offload 1"));
do_tx_1.deassert_reset();
// `INFO(("Bring up RX Data Offload 1"));
// do_rx_1.deassert_reset();
// `INFO(("Bring up TX Data Offload 1"));
// do_tx_1.deassert_reset();

// Enable tx oneshot mode
do_tx_0.enable_oneshot_mode();

do_tx_1.enable_oneshot_mode();
// do_tx_1.enable_oneshot_mode();

// bring up the DMAC instances from reset

Expand All @@ -167,17 +167,17 @@ program test_program;
`INFO(("Bring up TX DMAC 0"));
dmac_tx_0.enable_dma();

`INFO(("Bring up RX DMAC 1"));
dmac_rx_1.enable_dma();
`INFO(("Bring up TX DMAC 1"));
dmac_tx_1.enable_dma();
// `INFO(("Bring up RX DMAC 1"));
// dmac_rx_1.enable_dma();
// `INFO(("Bring up TX DMAC 1"));
// dmac_tx_1.enable_dma();

endtask

task do_set_transfer_length(input int length);
do_rx_0.set_transfer_length(length);

do_rx_1.set_transfer_length(length);
// do_rx_1.set_transfer_length(length);
endtask

// RX DMA transfer generator
Expand Down

0 comments on commit f2ea2cd

Please sign in to comment.