Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

Module Declaration Question for Transceiver Design

Hi, I was hoping someone could answer a fairly simple question. Here is my module declaration code for a transceiver design:

module xcvr_prbs (

//inputs

input wire phy_mgmt_clk,

input wire pll_ref_clk,

input wire reset_reset,

input wire reconfig_reset,

input wire rx_serial_data,

input wire rx_seriallpbken,

input wire xgmii_tx_clk,

input wire rx_serial_data_0,

input wire xgmii_tx_dc_0[71:0],

output wire xgmii_rx_clk,

output wire rx_data_ready,

output wire xgmii_rx_dc_0[71:0],

output wire tx_serial_data_0,

//ouputs

output wire errorFlag,

output wire [100:0] errorCount,

output wire tx_serial_data,

output wire tx_ready,

output wire rx_ready,

output wire [63:0] prbs_data_rx_top

);

My question is, how do I know whether to put input/output wires and registers inside the module parenthesis, or outside the parenthesis? I have been following some example transceiver designs and in those examples, some wires are declared inside and some outside. I am assuming the ones declared inside the module also need pin assignments. Is that correct?

Thanks in advance!

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the response. However, in my design, there are single declarations of different variables, not multiple declarations of the same variable; some are declared inside the parenthesis, some are outside. At least, this is what the native phy example I am following does and I am not sure how to decide what variables to declare inside and outside the module declaration.