Skip to content

Commit bbb374e

Browse files
committed
cn0577_adaq2387x: PR changes 1
Signed-off-by: Stanca Pop <[email protected]>
1 parent 7c25485 commit bbb374e

File tree

4 files changed

+35
-52
lines changed

4 files changed

+35
-52
lines changed

testbenches/project/cn0577_adaq2387x/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ include $(ADI_TB_DIR)/scripts/project-sim.mk
3232
# usage :
3333
#
3434
# run specific test on a specific configuration in gui mode
35-
# make CCFG=<configuration_name> TST=<test_name> MODE=gui
35+
# make CFG=<configuration_name> TST=<test_name> MODE=gui
3636
#
3737
# run all test from a configuration
3838
# make <configuration_name>

testbenches/project/cn0577_adaq2387x/system_bd.tcl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ set ADC_RES $ad_project_params(ADC_RES)
4141
set CN0577_ADAQ2387X_N $ad_project_params(CN0577_ADAQ2387X_N)
4242
set USE_MMCM $ad_project_params(USE_MMCM)
4343

44-
adi_project_files [list \
45-
"$ad_hdl_dir/library/common/ad_iobuf.v" \
46-
]
47-
4844
#
4945
# Block design under test
5046
#

testbenches/project/cn0577_adaq2387x/system_project.tcl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ set project_name [file rootname $cfg_file]
1616
# Set project params
1717
global ad_project_params
1818

19-
set TWOLANES $ad_project_params(TWOLANES)
20-
set ADC_RES $ad_project_params(ADC_RES)
21-
set CN0577_ADAQ2387X_N $ad_project_params(CN0577_ADAQ2387X_N)
22-
set USE_MMCM $ad_project_params(USE_MMCM)
23-
2419
# Set to use SmartConnect or AXI Interconnect
2520
set use_smartconnect 1
2621

testbenches/project/cn0577_adaq2387x/tests/test_program.sv

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,10 @@ program test_program (
6868
timeunit 1ns;
6969
timeprecision 1ps;
7070

71-
typedef enum {DATA_MODE_RANDOM, DATA_MODE_RAMP, DATA_MODE_PATTERN} offload_test_t;
72-
7371
test_harness_env #(`AXI_VIP_PARAMS(test_harness, mng_axi_vip), `AXI_VIP_PARAMS(test_harness, ddr_axi_vip)) base_env;
7472

75-
// set to active debug messages
76-
localparam bit DEBUG = 1;
77-
78-
// dco delay compared to the reference clk
79-
localparam DCO_DELAY = 12;
80-
81-
dmac_api cn0577_dmac_api;
82-
pwm_gen_api cn0577_pwm_gen_api;
73+
dmac_api dmac_api_inst;
74+
pwm_gen_api pwm_gen_api_inst;
8375
adc_api ltc2387_adc_api;
8476
common_api ltc2387_common_api;
8577

@@ -102,12 +94,13 @@ initial begin
10294
`TH.`SYS_RST.inst.IF,
10395
`TH.`MNG_AXI.inst.IF,
10496
`TH.`DDR_AXI.inst.IF);
105-
cn0577_dmac_api = new(
97+
98+
dmac_api_inst = new(
10699
"CN0577 DMAC API",
107100
base_env.mng.sequencer,
108101
`AXI_LTC2387_DMA_BA);
109102

110-
cn0577_pwm_gen_api = new(
103+
pwm_gen_api_inst = new(
111104
"CN0577 AXI PWM GEN API",
112105
base_env.mng.sequencer,
113106
`AXI_PWM_GEN_BA);
@@ -122,13 +115,13 @@ initial begin
122115
base_env.mng.sequencer,
123116
`AXI_LTC2387_BA);
124117

118+
setLoggerVerbosity(ADI_VERBOSITY_NONE);
119+
125120
base_env.start();
126121
base_env.sys_reset();
127122

128123
sanity_tests();
129124

130-
#100ns;
131-
132125
data_acquisition_test();
133126

134127
base_env.stop();
@@ -265,8 +258,8 @@ end
265258

266259
task sanity_tests();
267260
//ltc2387_common_api.sanity_test();
268-
cn0577_dmac_api.sanity_test();
269-
cn0577_pwm_gen_api.sanity_test();
261+
dmac_api_inst.sanity_test();
262+
pwm_gen_api_inst.sanity_test();
270263
`INFO(("Sanity Tests Done"), ADI_VERBOSITY_LOW);
271264
endtask
272265

@@ -288,45 +281,45 @@ task data_acquisition_test();
288281
end
289282

290283
// Configure AXI PWM GEN
291-
cn0577_pwm_gen_api.reset(); // PWM_GEN reset in regmap (ACTIVE HIGH)
284+
pwm_gen_api_inst.reset(); // PWM_GEN reset in regmap (ACTIVE HIGH)
292285

293-
cn0577_pwm_gen_api.pulse_period_config(
294-
.channel(8'h00),
295-
.period(32'h1A));
286+
pwm_gen_api_inst.pulse_period_config(
287+
.channel(8'd0),
288+
.period(32'd26));
296289

297-
cn0577_pwm_gen_api.pulse_width_config(
298-
.channel(8'h00),
299-
.width(32'h01));
290+
pwm_gen_api_inst.pulse_width_config(
291+
.channel(8'd0),
292+
.width(32'd1));
300293

301-
cn0577_pwm_gen_api.pulse_period_config(
302-
.channel(8'h01),
303-
.period(32'h1A));
294+
pwm_gen_api_inst.pulse_period_config(
295+
.channel(8'd1),
296+
.period(32'd26));
304297

305-
cn0577_pwm_gen_api.pulse_width_config(
306-
.channel(8'h01),
298+
pwm_gen_api_inst.pulse_width_config(
299+
.channel(8'd1),
307300
.width(num_of_dco));
308301

309-
cn0577_pwm_gen_api.pulse_offset_config(
310-
.channel(8'h01),
311-
.offset(32'h03));
302+
pwm_gen_api_inst.pulse_offset_config(
303+
.channel(8'd1),
304+
.offset(32'd3));
312305

313-
cn0577_pwm_gen_api.load_config(); // load AXI_PWM_GEN configuration
314-
cn0577_pwm_gen_api.start();
306+
pwm_gen_api_inst.load_config(); // load AXI_PWM_GEN configuration
307+
pwm_gen_api_inst.start();
315308
`INFO(("AXI_PWM_GEN started"), ADI_VERBOSITY_LOW);
316309

317310
// Configure DMA
318-
cn0577_dmac_api.set_irq_mask(
311+
dmac_api_inst.set_irq_mask(
319312
.transfer_completed(1'b0),
320313
.transfer_queued(1'b1));
321-
cn0577_dmac_api.enable_dma();
322-
cn0577_dmac_api.set_flags(
314+
dmac_api_inst.enable_dma();
315+
dmac_api_inst.set_flags(
323316
.cyclic(1'b0),
324317
.tlast(1'b1),
325318
.partial_reporting_en(1'b1));
326-
cn0577_dmac_api.set_lengths(
319+
dmac_api_inst.set_lengths(
327320
.xfer_length_x((NUM_OF_TRANSFERS*4)-1),
328321
.xfer_length_y(32'h0));
329-
cn0577_dmac_api.set_dest_addr(`DDR_BA);
322+
dmac_api_inst.set_dest_addr(`DDR_BA);
330323

331324
// Configure AXI_LTC2387
332325
ltc2387_adc_api.reset(
@@ -346,7 +339,7 @@ task data_acquisition_test();
346339

347340
transfer_status = 1;
348341

349-
cn0577_dmac_api.transfer_start();
342+
dmac_api_inst.transfer_start();
350343

351344
wait(transfer_cnt == 2 * NUM_OF_TRANSFERS );
352345

@@ -358,12 +351,12 @@ task data_acquisition_test();
358351
//@(posedge system_tb.test_harness.axi_ltc2387_dma.irq);
359352

360353
// Clear interrupt
361-
cn0577_dmac_api.clear_irq_pending(
354+
dmac_api_inst.clear_irq_pending(
362355
.transfer_completed(1'b1),
363356
.transfer_queued(1'b0));
364357

365358
// Stop pwm gen
366-
cn0577_pwm_gen_api.reset();
359+
pwm_gen_api_inst.reset();
367360
`INFO(("AXI_PWM_GEN stopped"), ADI_VERBOSITY_LOW);
368361

369362
// Configure axi_ltc2387
@@ -409,7 +402,6 @@ task data_acquisition_test();
409402

410403
#2000ns;
411404
for (int i=0; i<=((NUM_OF_TRANSFERS) -1); i=i+1) begin
412-
#1ns;
413405
captured_word_arr[i] = base_env.ddr.agent.mem_model.backdoor_memory_read_4byte(xil_axi_uint'(`DDR_BA + 4*i));
414406
end
415407

0 commit comments

Comments
 (0)