Skip to content
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

PulSAR LVDS #1273

Merged
merged 3 commits into from
Apr 16, 2024
Merged

PulSAR LVDS #1273

merged 3 commits into from
Apr 16, 2024

Conversation

PIoandan
Copy link
Collaborator

@PIoandan PIoandan commented Feb 9, 2024

PR Description

Add support for fast LVDS PulSAR AD762x/AD796x ADC.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the code style guidelines
  • I have performed a self-review of changes
  • I have compiled all hdl projects and libraries affected by this PR
  • I have tested in hardware affected projects, at least on relevant boards
  • 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/Critical Warnings on compilation
  • I have added new hdl testbenches or updated existing ones

parameter ADC_DATA_WIDTH = 16,
parameter BITS_PER_SAMPLE = 32
) (
input delay_clk,
Copy link
Contributor

Choose a reason for hiding this comment

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

please minimum amount of whitespaces to align signals
output [31:0] adc_data, => output [31:0] adc_data,

this aplies to most wire/reg declarations as well

// processor read interface

always @(negedge up_rstn or posedge up_clk) begin
if (up_rstn == 0) begin
Copy link
Contributor

Choose a reason for hiding this comment

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

change line to
if (!up_rstn) begin


// adc interface

input adc_clk,
Copy link
Contributor

Choose a reason for hiding this comment

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

use fewer whitespaces for alignment


// delay interface

input up_clk,
Copy link
Contributor

Choose a reason for hiding this comment

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

use fewer whitespaces

.DELAY_REFCLK_FREQUENCY (DELAY_REFCLK_FREQUENCY),
.IODELAY_CTRL (IODELAY_CTRL),
.ADC_DATA_WIDTH (ADC_DATA_WIDTH)

Copy link
Contributor

Choose a reason for hiding this comment

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

remove blank line

ad_ip_parameter reference_clkgen CONFIG.VCO_DIV 1
ad_ip_parameter reference_clkgen CONFIG.VCO_MUL 10
ad_ip_parameter reference_clkgen CONFIG.CLK0_DIV 6
#ad_ip_parameter reference_clkgen CONFIG.CLK1_DIV 4
Copy link
Contributor

Choose a reason for hiding this comment

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

remove commented line


module system_top (

inout [14:0] ddr_addr,
Copy link
Contributor

Choose a reason for hiding this comment

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

too many whitespaces used for alignment


// internal signals

wire [63:0] gpio_i;
Copy link
Contributor

Choose a reason for hiding this comment

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

too many whitespaces used for alignment

@PIoandan PIoandan force-pushed the pulsar_lvds_dev branch 3 times, most recently from fb7b120 to fa02ebd Compare March 21, 2024 07:36
@PIoandan
Copy link
Collaborator Author

Made the requested changes.

@PIoandan PIoandan requested a review from sarpadi March 21, 2024 07:38
Signed-off-by: Ioan-daniel Pop <Pop.Ioan-daniel@analog.com>
Signed-off-by: Ioan-daniel Pop <Pop.Ioan-daniel@analog.com>
sarpadi
sarpadi previously approved these changes Mar 22, 2024
@bia1708
Copy link
Collaborator

bia1708 commented Mar 26, 2024

RetriggerCI

Copy link
Contributor

@gastmaier gastmaier left a comment

Choose a reason for hiding this comment

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

Minor comments
Tested synthesize on both 16/18 resolutions.
No critical warnings

ad_cpu_interconnect 0x44A30000 axi_pulsar_lvds_dma
ad_cpu_interconnect 0x44A60000 axi_pwm_gen
ad_cpu_interconnect 0x44a80000 reference_clkgen
# interconnect (adc)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add blank line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

ad_cpu_interconnect 0x44A00000 axi_pulsar_lvds
ad_cpu_interconnect 0x44A30000 axi_pulsar_lvds_dma
ad_cpu_interconnect 0x44A60000 axi_pwm_gen
ad_cpu_interconnect 0x44a80000 reference_clkgen
Copy link
Contributor

Choose a reason for hiding this comment

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

Uppercase this hex value, or lower case the others hex values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

set ADC_DATA_WIDTH [expr {$RESOLUTION_16_18N == 1 ? 16 : 18}]
set BITS_PER_SAMPLE [expr {$RESOLUTION_16_18N == 1 ? 16 : 32}]

# ltc2387
Copy link
Contributor

Choose a reason for hiding this comment

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

Add blank line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

How to use over-writable parameters from the environment:
```
hdl/projects/pulsar_lvds_adc/zed> make RESOLUTION_16_18N=0
RESOLUTION_16_18N - Defines the resolution of the ADC: 0 - 18 BITS, 1 - 16 BITS.
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing closing ```

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

set BITS_PER_SAMPLE [expr {$RESOLUTION_16_18N == 1 ? 16 : 32}]

# ltc2387
create_bd_port -dir I ref_clk
Copy link
Contributor

Choose a reason for hiding this comment

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

This port doesn't seem to be used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Deleted it for now.

ad_connect d_n axi_pulsar_lvds/d_n

ad_connect reference_clkgen/clk_0 axi_pulsar_lvds_dma/fifo_wr_clk
ad_connect axi_pulsar_lvds/adc_valid axi_pulsar_lvds_dma/fifo_wr_en
Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't adc_valid , adc_data , and adc_dovf a single fifo_wr interface?

`timescale 1ns/100ps

module axi_pulsar_lvds #(

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove extra line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

"axi_pulsar_lvds.v" ]

adi_ip_properties axi_pulsar_lvds

Copy link
Contributor

Choose a reason for hiding this comment

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

You could pack adc_valid, adc_data, adc_dovf into a fifo_wr interface, so when you connect to the axi_dmac/fifo_wr(slave) it doesn't raise unnecessary warnings.

Suggested change
adi_add_bus "fifo_wr" "master" \
"analog.com:interface:fifo_wr_rtl:1.0" \
"analog.com:interface:fifo_wr:1.0" \
{ \
{"adc_valid" "EN"} \
{"adc_data" "DATA"} \
{"adc_dovf " "OVERFLOW"} \
}
adi_add_bus_clock "fifo_wr_clk" "fifo_wr"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

// dma interface

output adc_valid,
output [31:0] adc_data,
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this be

Suggested change
output [31:0] adc_data,
output [BITS_PER_SAMPLE-1:0] adc_data,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.


output adc_enable,
output adc_valid,
output [31:0] adc_data,
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this be

Suggested change
output [31:0] adc_data,
output [BITS_PER_SAMPLE-1:0] adc_data,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: Ioan-daniel Pop <Pop.Ioan-daniel@analog.com>
Copy link
Contributor

@PopPaul2021 PopPaul2021 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

.DELAY_REFCLK_FREQUENCY (DELAY_REFCLK_FREQUENCY),
.IODELAY_CTRL (IODELAY_CTRL),
.ADC_DATA_WIDTH (ADC_DATA_WIDTH)

Copy link
Contributor

Choose a reason for hiding this comment

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

There is an extra empty line here.

ad_ip_parameter reference_clkgen CONFIG.VCO_DIV 1
ad_ip_parameter reference_clkgen CONFIG.VCO_MUL 10
ad_ip_parameter reference_clkgen CONFIG.CLK0_DIV 6
#ad_ip_parameter reference_clkgen CONFIG.CLK1_DIV 4
Copy link
Contributor

Choose a reason for hiding this comment

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

This line can be deleted.

@sarpadi sarpadi dismissed gastmaier’s stale review April 16, 2024 08:18

changes done

@sarpadi sarpadi merged commit ab4ea30 into main Apr 16, 2024
1 of 3 checks passed
@sarpadi sarpadi deleted the pulsar_lvds_dev branch April 16, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants