Lint: TARGET parameter has problematic widths
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Domain
- embedded-iot
Research direction
Start by reproducing the Verilator warnings and inspect the TARGET declarations and comparisons in src/lowrisc_ethernet_mac_0/oddr.sv and iddr.sv. Locate the other modules that define TARGET, then verify that supported values such as XILINX and SIM no longer produce inconsistent-width warnings. Re-run the relevant Verilator lint checks to confirm the warnings are gone.
Written by the indexing model from the issue text.
Description
When linted with Verilator, the TARGET parameter (which is present on many modules) causes many WIDTHEXPAND warnings
Because no type is given, the parser infers an array of bytes. When the default value is "XILINX", it infers an array of 6 bytes. When a value of "SIM" is provided, this gives lots of inconsistent width errors.
%Warning-WIDTHEXPAND: src/lowrisc_ethernet_mac_0/oddr.sv:101:21: Operator EQ expects 48 bits on the LHS, but LHS's VARREF 'TARGET' generates 24 bits.
: ... note: In instance 'ethernet_top_axi_tb.dut.ethernet_top_inst.mac_wrapper_inst.rgmii_soc_inst.core_inst.eth_mac_inst.eth_mac_1g_rgmii_inst.rgmii_phy_if_inst.clk_oddr_inst'
101 | end else if (TARGET == "ALTERA") begin : gen_altera_target
| ^~
%Warning-WIDTHEXPAND: src/lowrisc_ethernet_mac_0/iddr.sv:68:12: Operator EQ expects 48 bits on the LHS, but LHS's VARREF 'TARGET' generates 24 bits.
: ... note: In instance 'ethernet_top_axi_tb.dut.ethernet_top_inst.mac_wrapper_inst.rgmii_soc_inst.core_inst.eth_mac_inst.eth_mac_1g_rgmii_inst.rgmii_phy_if_inst.rx_ssio_ddr_inst.data_iddr_inst'
68 | if (TARGET == "XILINX") begin : gen_xilinx_iddr
| ^~
- Dominant language
- SystemVerilog
- Stars
- 23
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lowRISC/ethernet
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in lowRISC/ethernet
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
boards: microchip: pic32cz_ca80_cult and pic32cz_ca90_cult give DMAC channel 3 to two peripherals Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
zephyrproject-rtos/zephyr#119843 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
new device support
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Koenkk/zigbee2mqtt#33176 · 1 comment ·
-
status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PX4/PX4-Autopilot#28776 ·