1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-01-30 02:32:53 +08:00

Fixing careless mistakes..

This commit is contained in:
Andreas Olofsson 2015-11-06 22:51:09 -05:00
parent 9383f32764
commit 65f772ddef
5 changed files with 84 additions and 84 deletions

View File

@ -153,7 +153,6 @@ module elink (/*AUTOARG*/
*/ */
defparam erx.ID = ID; defparam erx.ID = ID;
defparam erx.IOSTD_ELINK = IOSTD_ELINK;
defparam erx.ETYPE = ETYPE; defparam erx.ETYPE = ETYPE;
erx erx(.rx_active (elink_active), erx erx(.rx_active (elink_active),
@ -205,7 +204,6 @@ module elink (/*AUTOARG*/
*/ */
defparam etx.ID = ID; defparam etx.ID = ID;
defparam etx.IOSTD_ELINK = IOSTD_ELINK;
defparam etx.ETYPE = ETYPE; defparam etx.ETYPE = ETYPE;
etx etx(.etx_nreset (etx_nreset), etx etx(.etx_nreset (etx_nreset),

View File

@ -106,33 +106,32 @@ module erx (/*AUTOARG*/
/***********************************************************/ /***********************************************************/
/*RECEIVER I/O LOGIC */ /*RECEIVER I/O LOGIC */
/***********************************************************/ /***********************************************************/
defparam erx_io.IOSTD_ELINK=IOSTD_ELINK; erx_io #(.ETYPE(ETYPE))
defparam erx_io.ETYPE=ETYPE; erx_io (
erx_io erx_io (
/*AUTOINST*/ /*AUTOINST*/
// Outputs // Outputs
.rx_clkin (rx_clkin), .rx_clkin (rx_clkin),
.rxo_wr_wait_p (rxo_wr_wait_p), .rxo_wr_wait_p (rxo_wr_wait_p),
.rxo_wr_wait_n (rxo_wr_wait_n), .rxo_wr_wait_n (rxo_wr_wait_n),
.rxo_rd_wait_p (rxo_rd_wait_p), .rxo_rd_wait_p (rxo_rd_wait_p),
.rxo_rd_wait_n (rxo_rd_wait_n), .rxo_rd_wait_n (rxo_rd_wait_n),
.rx_access (rx_access), .rx_access (rx_access),
.rx_burst (rx_burst), .rx_burst (rx_burst),
.rx_packet (rx_packet[PW-1:0]), .rx_packet (rx_packet[PW-1:0]),
// Inputs // Inputs
.erx_io_nreset (erx_io_nreset), .erx_io_nreset (erx_io_nreset),
.rx_lclk (rx_lclk), .rx_lclk (rx_lclk),
.rx_lclk_div4 (rx_lclk_div4), .rx_lclk_div4 (rx_lclk_div4),
.idelay_value (idelay_value[44:0]), .idelay_value (idelay_value[44:0]),
.load_taps (load_taps), .load_taps (load_taps),
.rxi_lclk_p (rxi_lclk_p), .rxi_lclk_p (rxi_lclk_p),
.rxi_lclk_n (rxi_lclk_n), .rxi_lclk_n (rxi_lclk_n),
.rxi_frame_p (rxi_frame_p), .rxi_frame_p (rxi_frame_p),
.rxi_frame_n (rxi_frame_n), .rxi_frame_n (rxi_frame_n),
.rxi_data_p (rxi_data_p[7:0]), .rxi_data_p (rxi_data_p[7:0]),
.rxi_data_n (rxi_data_n[7:0]), .rxi_data_n (rxi_data_n[7:0]),
.rx_wr_wait (rx_wr_wait), .rx_wr_wait (rx_wr_wait),
.rx_rd_wait (rx_rd_wait)); .rx_rd_wait (rx_rd_wait));
/**************************************************************/ /**************************************************************/
/*ELINK CORE LOGIC */ /*ELINK CORE LOGIC */

View File

@ -103,28 +103,28 @@ module erx_clocks (/*AUTOARG*/
always @ (posedge sys_clk or negedge rx_nreset_in) always @ (posedge sys_clk or negedge rx_nreset_in)
if(!rx_nreset_in) if(!rx_nreset_in)
reset_state[2:0] <= `RESET_ALL; reset_state[2:0] <= `RX_RESET_ALL;
else if(heartbeat) else if(heartbeat)
case(reset_state[2:0]) case(reset_state[2:0])
`RESET_ALL : `RX_RESET_ALL :
if(~soft_reset) if(~soft_reset)
reset_state[2:0] <= `START_PLL; reset_state[2:0] <= `RX_START_PLL;
`START_PLL : `RX_START_PLL :
if(pll_locked_sync & idelay_ready) if(pll_locked_sync & idelay_ready)
reset_state[2:0] <= `ACTIVE; reset_state[2:0] <= `RX_ACTIVE;
`ACTIVE: `RX_ACTIVE:
if(soft_reset) if(soft_reset)
reset_state[2:0] <= `RESET_ALL; //stay there until next reset reset_state[2:0] <= `RX_RESET_ALL; //stay there until next reset
endcase // case (reset_state[2:0]) endcase // case (reset_state[2:0])
assign pll_reset = (reset_state[2:0]==`RESET_ALL); assign pll_reset = (reset_state[2:0]==`RX_RESET_ALL);
assign idelay_reset = (reset_state[2:0]==`RESET_ALL); assign idelay_reset = (reset_state[2:0]==`RX_RESET_ALL);
//asynch rx block reset //asynch rx block reset
assign rx_nreset = ~(reset_state[2:0] != `ACTIVE); assign rx_nreset = ~(reset_state[2:0] != `RX_ACTIVE);
//active indicator //active indicator
assign rx_active = (reset_state[2:0] == `ACTIVE); assign rx_active = (reset_state[2:0] == `RX_ACTIVE);
//############################# //#############################
//#RESET SYNCING //#RESET SYNCING
@ -133,13 +133,15 @@ module erx_clocks (/*AUTOARG*/
.nrst_out (erx_io_nreset), .nrst_out (erx_io_nreset),
// Inputs // Inputs
.clk (rx_lclk), .clk (rx_lclk),
.nrst_in (rx_nreset)); .nrst_in (rx_nreset)
);
rsync rsync_core (// Outputs rsync rsync_core (// Outputs
.nrst_out (erx_nreset), .nrst_out (erx_nreset),
// Inputs // Inputs
.clk (rx_lclk_div4), .clk (rx_lclk_div4),
.nrst_in (rx_nreset)); .nrst_in (rx_nreset)
);
`ifdef TARGET_XILINX `ifdef TARGET_XILINX

View File

@ -182,29 +182,30 @@ module etx(/*AUTOARG*/
/*TRANSMIT I/O LOGIC */ /*TRANSMIT I/O LOGIC */
/***********************************************************/ /***********************************************************/
etx_io etx_io (.nreset (etx_io_nreset), etx_io #(.ETYPE(ETYPE))
etx_io (.nreset (etx_io_nreset),
/*AUTOINST*/ /*AUTOINST*/
// Outputs // Outputs
.txo_lclk_p (txo_lclk_p), .txo_lclk_p (txo_lclk_p),
.txo_lclk_n (txo_lclk_n), .txo_lclk_n (txo_lclk_n),
.txo_frame_p (txo_frame_p), .txo_frame_p (txo_frame_p),
.txo_frame_n (txo_frame_n), .txo_frame_n (txo_frame_n),
.txo_data_p (txo_data_p[7:0]), .txo_data_p (txo_data_p[7:0]),
.txo_data_n (txo_data_n[7:0]), .txo_data_n (txo_data_n[7:0]),
.tx_io_wait (tx_io_wait), .tx_io_wait (tx_io_wait),
.tx_wr_wait (tx_wr_wait), .tx_wr_wait (tx_wr_wait),
.tx_rd_wait (tx_rd_wait), .tx_rd_wait (tx_rd_wait),
// Inputs // Inputs
.tx_lclk (tx_lclk), .tx_lclk (tx_lclk),
.tx_lclk_io (tx_lclk_io), .tx_lclk_io (tx_lclk_io),
.tx_lclk90 (tx_lclk90), .tx_lclk90 (tx_lclk90),
.txi_wr_wait_p (txi_wr_wait_p), .txi_wr_wait_p (txi_wr_wait_p),
.txi_wr_wait_n (txi_wr_wait_n), .txi_wr_wait_n (txi_wr_wait_n),
.txi_rd_wait_p (txi_rd_wait_p), .txi_rd_wait_p (txi_rd_wait_p),
.txi_rd_wait_n (txi_rd_wait_n), .txi_rd_wait_n (txi_rd_wait_n),
.tx_packet (tx_packet[PW-1:0]), .tx_packet (tx_packet[PW-1:0]),
.tx_access (tx_access), .tx_access (tx_access),
.tx_burst (tx_burst)); .tx_burst (tx_burst));
endmodule // elink endmodule // elink

View File

@ -110,44 +110,44 @@ module etx_clocks (/*AUTOARG*/
//Reset sequence state machine //Reset sequence state machine
always @ (posedge sys_clk or negedge sys_nreset) always @ (posedge sys_clk or negedge sys_nreset)
if(!sys_nreset) if(!sys_nreset)
reset_state[2:0] <= `RESET_ALL; reset_state[2:0] <= `TX_RESET_ALL;
else if(heartbeat) else if(heartbeat)
case(reset_state[2:0]) case(reset_state[2:0])
`RESET_ALL : `TX_RESET_ALL :
if(~soft_reset) if(~soft_reset)
reset_state[2:0] <= `START_CCLK; reset_state[2:0] <= `TX_START_CCLK;
`START_CCLK : `TX_START_CCLK :
if(mmcm_locked_sync) if(mmcm_locked_sync)
reset_state[2:0] <= `STOP_CCLK; reset_state[2:0] <= `TX_STOP_CCLK;
`STOP_CCLK : `TX_STOP_CCLK :
reset_state[2:0] <= `DEASSERT_RESET; reset_state[2:0] <= `TX_DEASSERT_RESET;
`DEASSERT_RESET : `TX_DEASSERT_RESET :
reset_state[2:0] <= `HOLD_IT; reset_state[2:0] <= `TX_HOLD_IT;
`HOLD_IT : `TX_HOLD_IT :
if(mmcm_locked_sync) if(mmcm_locked_sync)
reset_state[2:0] <= `ACTIVE; reset_state[2:0] <= `TX_ACTIVE;
`ACTIVE: `TX_ACTIVE:
if(soft_reset) if(soft_reset)
reset_state[2:0] <= `RESET_ALL; //stay there until nex reset reset_state[2:0] <= `TX_RESET_ALL; //stay there until nex reset
endcase // case (reset_state[2:0]) endcase // case (reset_state[2:0])
//reset mmcm (async) //reset mmcm (async)
assign mmcm_reset = (reset_state[2:0]==`RESET_ALL) | assign mmcm_reset = (reset_state[2:0]==`TX_RESET_ALL) |
(reset_state[2:0]==`STOP_CCLK) | (reset_state[2:0]==`TX_STOP_CCLK) |
(reset_state[2:0]==`DEASSERT_RESET) (reset_state[2:0]==`TX_DEASSERT_RESET)
; ;
//reset chip (active low) //reset chip (active low)
assign chip_nreset = (reset_state[2:0]==`DEASSERT_RESET) | assign chip_nreset = (reset_state[2:0]==`TX_DEASSERT_RESET) |
(reset_state[2:0]==`HOLD_IT) | (reset_state[2:0]==`TX_HOLD_IT) |
(reset_state[2:0]==`ACTIVE); (reset_state[2:0]==`TX_ACTIVE);
//reset the elink //reset the elink
assign tx_nreset = ~(reset_state[2:0] != `ACTIVE); assign tx_nreset = ~(reset_state[2:0] != `TX_ACTIVE);
assign tx_active = (reset_state[2:0] == `ACTIVE); assign tx_active = (reset_state[2:0] == `TX_ACTIVE);
//############################# //#############################
//#RESET SYNCING //#RESET SYNCING