-
Notifications
You must be signed in to change notification settings - Fork 22
cn0577_adaq2387x: Add testbench #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
To be tested with analogdevicesinc/hdl#1870 |
8138e90
to
8979778
Compare
|
||
sanity_test(); | ||
|
||
#100 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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;
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
8979778
to
d7b9d72
Compare
a72fa8b
to
4bad4c0
Compare
4bad4c0
to
e8aaf6e
Compare
af9bb89
to
3041862
Compare
3041862
to
c5eca49
Compare
To be used with the HDL main branch. |
adi_project_files [list \ | ||
"$ad_hdl_dir/library/common/ad_iobuf.v" \ | ||
] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
parameter ID = 0; | ||
parameter FPGA_TECHNOLOGY = 1; | ||
parameter IO_DELAY_GROUP = "adc_if_delay_group"; | ||
parameter DELAY_REFCLK_FREQUENCY = 200; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
initial begin | ||
s_axi_aresetn <= 1'b0; | ||
repeat(10) @(posedge s_axi_aclk); | ||
s_axi_aresetn <= 1'b1; | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused code block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
`TH.`DDR_AXI.inst.IF); | ||
cn0577_dmac_api = new( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
sanity_tests(); | ||
|
||
#100ns; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed.
There was a problem hiding this comment.
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?
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:
Solution:
|
Signed-off-by: Stanca Pop <stanca.pop@analog.com>
228d497
to
8744b4d
Compare
Signed-off-by: Stanca Pop <stanca.pop@analog.com>
Since the cn0577 & adaq2387x projects have been separated in HDL, repurposed this testbench to support both projects. |
PR Description
Add testbench support for cn0577 & adaq2387x.
PR Type
PR Checklist