Skip to content

Conversation

StancaPop
Copy link
Contributor

@StancaPop StancaPop commented Aug 5, 2025

PR Description

Add testbench support for cn0577 & adaq2387x.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • New test (change that adds new test program and/or testbench)
  • Breaking change (has dependencies in other repositories/testbenches)
  • Documentation (change that adds or modifies documentation)

PR Checklist

  • I have followed the code style guidelines
  • I have performed a self-review of changes
  • I have ran all testbenches affected by this PR
  • I have commented my code, at least hard-to-understand parts
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe files, Copyright etc)
  • I have not introduced new Warnings/Errors on compilation/elaboration/simulation
  • I have set the verbosity level to none for the test program

@StancaPop StancaPop requested a review from a team as a code owner August 5, 2025 16:06
@StancaPop StancaPop added the new New testbench label Aug 5, 2025
@StancaPop StancaPop marked this pull request as draft August 5, 2025 16:08
@StancaPop
Copy link
Contributor Author

To be tested with analogdevicesinc/hdl#1870

@StancaPop StancaPop marked this pull request as ready for review August 6, 2025 12:57
@StancaPop StancaPop force-pushed the add_cn0577_tb_s branch 2 times, most recently from 8138e90 to 8979778 Compare August 12, 2025 12:34

sanity_test();

#100
Copy link

@caosjr caosjr Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it is on my side, but it is showing a weird character before #100. The same happens for other delays throughout the source code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it show something like this on your side as well? I'm using Visual Studio Code, and this is something that manifested only now. Seems to be a new feature of VS Code, as in Vivado's integrated IDE and GitHub it shows normally.
On a side-note on this is that regardless of the IDE behavior, a timescale must be added to the end of the delay, so that the simulation tool will always wait for the specified amount of time, irrelevant of the simulation's global timescale. For example: #100ns;
image

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is showing the same character. I have never seem it in other projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you recheck if the character is still showing?

// --------------------------
// Wrapper function for AXI read verif
// --------------------------
task axi_read_v(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it supposed to remove axi_read_v, axi_read, and axi_write and use its API? I guess in this case it would be adc_api, right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is. The AXI_LTC2387 is like most of the other IPs that are modular using the Common and ADC and/or DAC register maps. The LTC seems to be created using the Common and the ADC, so 2 APIs for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned up - removed the axi rd/wr and used the APIs.

output db_p,
output reg dco_p,
output reg dco_n,
output cnv);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cnv port should be input for the testbench, no? The documentation for the LTC2387 shows this port as an input .
conv_port_ltc2387

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thank you for noticing.

github-actions bot added a commit that referenced this pull request Sep 9, 2025
github-actions bot added a commit that referenced this pull request Sep 9, 2025
github-actions bot added a commit that referenced this pull request Sep 9, 2025
github-actions bot added a commit that referenced this pull request Sep 9, 2025
github-actions bot added a commit that referenced this pull request Sep 9, 2025
github-actions bot added a commit that referenced this pull request Sep 9, 2025
github-actions bot added a commit that referenced this pull request Sep 9, 2025
github-actions bot added a commit that referenced this pull request Sep 9, 2025
@StancaPop
Copy link
Contributor Author

To be used with the HDL main branch.

Comment on lines +42 to +44
adi_project_files [list \
"$ad_hdl_dir/library/common/ad_iobuf.v" \
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ad_iobuf.v is not used in the design, so it should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +42 to +45
parameter ID = 0;
parameter FPGA_TECHNOLOGY = 1;
parameter IO_DELAY_GROUP = "adc_if_delay_group";
parameter DELAY_REFCLK_FREQUENCY = 200;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +69 to +91
// axi interface

reg s_axi_aclk = 1'b0;
reg s_axi_aresetn = 1'b0;
reg s_axi_awvalid = 1'b0;
reg [15:0] s_axi_awaddr = 16'b0;
wire s_axi_awready;
reg s_axi_wvalid = 1'b0;
reg [31:0] s_axi_wdata = 32'b0;
reg [ 3:0] s_axi_wstrb = 4'b0;
wire s_axi_wready;
wire s_axi_bvalid;
wire [ 1:0] s_axi_bresp;
reg s_axi_bready = 1'b0;
reg s_axi_arvalid = 1'b0;
reg [15:0] s_axi_araddr = 1'b0;
wire s_axi_arready;
wire s_axi_rvalid;
wire [ 1:0] s_axi_rresp;
wire [31:0] s_axi_rdata;
reg s_axi_rready = 1'b0;
reg [ 2:0] s_axi_awprot = 3'b0;
reg [ 2:0] s_axi_arprot = 3'b0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +116 to +120
initial begin
s_axi_aresetn <= 1'b0;
repeat(10) @(posedge s_axi_aclk);
s_axi_aresetn <= 1'b1;
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused code block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CN0577 environment doesn't do anything, so it can be removed. Please remove from other files and dependencies as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +105 to +106
`TH.`DDR_AXI.inst.IF);
cn0577_dmac_api = new(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line between the two.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


sanity_tests();

#100ns;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the delay or the entire sanity tests section?

github-actions bot added a commit that referenced this pull request Sep 17, 2025
@StancaPop
Copy link
Contributor Author

Converting the testbench to draft since the cn0577 HDL reference design will be updated here: analogdevicesinc/hdl#1919

This will cause the testbench to fail because of the following modification:

  • ADC_RES parameter has been removed; the cn0577 design will support only the LTC2387-18 variant

Solution:

  • This testbench can be renamed and repurposed for the adaq2387x family, that was separated from the cn0577 (both being built around axi_ltc2387) and supports both resolutions. The HDL project is still under development.

@StancaPop StancaPop marked this pull request as draft September 17, 2025 13:14
Signed-off-by: Stanca Pop <stanca.pop@analog.com>
github-actions bot added a commit that referenced this pull request Sep 22, 2025
Signed-off-by: Stanca Pop <stanca.pop@analog.com>
github-actions bot added a commit that referenced this pull request Sep 22, 2025
@StancaPop StancaPop changed the title cn0577: Add testbench cn0577_adaq2387x: Add testbench Sep 22, 2025
@StancaPop
Copy link
Contributor Author

Since the cn0577 & adaq2387x projects have been separated in HDL, repurposed this testbench to support both projects.
To be tested with: https://github.com/analogdevicesinc/hdl/tree/add_adaq2387x_s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new New testbench

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants