URL
https://opencores.org/ocsvn/gpio/gpio/trunk
Subversion Repositories gpio
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 59 to Rev 60
- ↔ Reverse comparison
Rev 59 → Rev 60
/trunk/rtl/verilog/gpio_top.v
45,6 → 45,9
// CVS Revision History |
// |
// $Log: not supported by cvs2svn $ |
// Revision 1.16 2003/12/17 13:00:52 gorand |
// added ECLK and NEC registers, all tests passed. |
// |
// Revision 1.15 2003/11/10 23:21:22 gorand |
// bug fixed. all tests passed. |
// |
115,7 → 118,7
aux_i, |
|
// External GPIO Interface |
ext_pad_i, clk_pad_i, ext_pad_o, ext_padoen_o |
ext_pad_i, clk_pad_i, ext_pad_o, ext_padoe_o |
); |
|
parameter dw = 32; |
146,7 → 149,7
input [gw-1:0] ext_pad_i; // GPIO Inputs |
input clk_pad_i; // GPIO Eclk |
output [gw-1:0] ext_pad_o; // GPIO Outputs |
output [gw-1:0] ext_padoen_o; // GPIO output drivers enables |
output [gw-1:0] ext_padoe_o; // GPIO output drivers enables |
|
`ifdef GPIO_IMPLEMENTED |
|
345,19 → 348,35
// |
// GPIO registers address decoder |
// |
`ifdef GPIO_RGPIO_OUT |
assign rgpio_out_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_OUT) & full_decoding; |
`endif |
`ifdef GPIO_RGPIO_OE |
assign rgpio_oe_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_OE) & full_decoding; |
`endif |
`ifdef GPIO_RGPIO_INTE |
assign rgpio_inte_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_INTE) & full_decoding; |
`endif |
`ifdef GPIO_RGPIO_PTRIG |
assign rgpio_ptrig_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_PTRIG) & full_decoding; |
`endif |
`ifdef GPIO_RGPIO_AUX |
assign rgpio_aux_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_AUX) & full_decoding; |
`endif |
`ifdef GPIO_RGPIO_CTRL |
assign rgpio_ctrl_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_CTRL) & full_decoding; |
`endif |
`ifdef GPIO_RGPIO_INTS |
assign rgpio_ints_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_INTS) & full_decoding; |
|
`endif |
`ifdef GPIO_RGPIO_ECLK |
assign rgpio_eclk_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_ECLK) & full_decoding; |
`endif |
`ifdef GPIO_RGPIO_NEC |
assign rgpio_nec_sel = wb_cyc_i & wb_stb_i & (wb_adr_i[`GPIO_OFS_BITS] == `GPIO_RGPIO_NEC) & full_decoding; |
`endif |
|
|
|
// |
// Write to RGPIO_CTRL or update of RGPIO_CTRL[INT] bit |
// |
421,7 → 440,7
`endif |
|
// |
// Write to RGPIO_OE. Bits in RGPIO_OE are stored inverted. |
// Write to RGPIO_OE. |
// |
`ifdef GPIO_RGPIO_OE |
always @(posedge wb_clk_i or posedge wb_rst_i) |
430,41 → 449,41
else if (rgpio_oe_sel && wb_we_i) |
begin |
`ifdef GPIO_STRICT_32BIT_ACCESS |
rgpio_oe <= #1 ~wb_dat_i[gw-1:0]; |
rgpio_oe <= #1 wb_dat_i[gw-1:0]; |
`endif |
|
`ifdef GPIO_WB_BYTES4 |
if ( wb_sel_i [3] == 1'b1 ) |
rgpio_oe [gw-1:24] <= #1 ~wb_dat_i [gw-1:24] ; |
rgpio_oe [gw-1:24] <= #1 wb_dat_i [gw-1:24] ; |
if ( wb_sel_i [2] == 1'b1 ) |
rgpio_oe [23:16] <= #1 ~wb_dat_i [23:16] ; |
rgpio_oe [23:16] <= #1 wb_dat_i [23:16] ; |
if ( wb_sel_i [1] == 1'b1 ) |
rgpio_oe [15:8] <= #1 ~wb_dat_i [15:8] ; |
rgpio_oe [15:8] <= #1 wb_dat_i [15:8] ; |
if ( wb_sel_i [0] == 1'b1 ) |
rgpio_oe [7:0] <= #1 ~wb_dat_i [7:0] ; |
rgpio_oe [7:0] <= #1 wb_dat_i [7:0] ; |
`endif |
`ifdef GPIO_WB_BYTES3 |
if ( wb_sel_i [2] == 1'b1 ) |
rgpio_oe [gw-1:16] <= #1 ~wb_dat_i [gw-1:16] ; |
rgpio_oe [gw-1:16] <= #1 wb_dat_i [gw-1:16] ; |
if ( wb_sel_i [1] == 1'b1 ) |
rgpio_oe [15:8] <= #1 ~wb_dat_i [15:8] ; |
rgpio_oe [15:8] <= #1 wb_dat_i [15:8] ; |
if ( wb_sel_i [0] == 1'b1 ) |
rgpio_oe [7:0] <= #1 ~wb_dat_i [7:0] ; |
rgpio_oe [7:0] <= #1 wb_dat_i [7:0] ; |
`endif |
`ifdef GPIO_WB_BYTES2 |
if ( wb_sel_i [1] == 1'b1 ) |
rgpio_oe [gw-1:8] <= #1 ~wb_dat_i [gw-1:8] ; |
rgpio_oe [gw-1:8] <= #1 wb_dat_i [gw-1:8] ; |
if ( wb_sel_i [0] == 1'b1 ) |
rgpio_oe [7:0] <= #1 ~wb_dat_i [7:0] ; |
rgpio_oe [7:0] <= #1 wb_dat_i [7:0] ; |
`endif |
`ifdef GPIO_WB_BYTES1 |
if ( wb_sel_i [0] == 1'b1 ) |
rgpio_oe [gw-1:0] <= #1 ~wb_dat_i [gw-1:0] ; |
rgpio_oe [gw-1:0] <= #1 wb_dat_i [gw-1:0] ; |
`endif |
end |
|
`else |
assign rgpio_oe = `GPIO_DEF_RPGIO_OE; // RGPIO_OE = 0x0 |
assign rgpio_oe = `GPIO_DEF_RGPIO_OE; // RGPIO_OE = 0x0 |
`endif |
|
// |
512,7 → 531,7
|
|
`else |
assign rgpio_inte = `GPIO_DEF_RPGIO_INTE; // RGPIO_INTE = 0x0 |
assign rgpio_inte = `GPIO_DEF_RGPIO_INTE; // RGPIO_INTE = 0x0 |
`endif |
|
// |
559,7 → 578,7
end |
|
`else |
assign rgpio_ptrig = `GPIO_DEF_RPGIO_PTRIG; // RGPIO_PTRIG = 0x0 |
assign rgpio_ptrig = `GPIO_DEF_RGPIO_PTRIG; // RGPIO_PTRIG = 0x0 |
`endif |
|
// |
606,7 → 625,7
end |
|
`else |
assign rgpio_aux = `GPIO_DEF_RPGIO_AUX; // RGPIO_AUX = 0x0 |
assign rgpio_aux = `GPIO_DEF_RGPIO_AUX; // RGPIO_AUX = 0x0 |
`endif |
|
|
655,7 → 674,7
|
|
`else |
assign rgpio_eclk = `GPIO_DEF_RPGIO_ECLK; // RGPIO_ECLK = 0x0 |
assign rgpio_eclk = `GPIO_DEF_RGPIO_ECLK; // RGPIO_ECLK = 0x0 |
`endif |
|
|
705,7 → 724,7
|
|
`else |
assign rgpio_nec = `GPIO_DEF_RPGIO_NEC; // RGPIO_NEC = 0x0 |
assign rgpio_nec = `GPIO_DEF_RGPIO_NEC; // RGPIO_NEC = 0x0 |
`endif |
|
|
1421,35 → 1440,53
rgpio_ptrig or rgpio_aux or rgpio_ctrl or rgpio_ints or rgpio_eclk or rgpio_nec) |
case (wb_adr_i[`GPIO_OFS_BITS]) // synopsys full_case parallel_case |
`ifdef GPIO_READREGS |
`GPIO_RGPIO_OUT: begin |
`ifdef GPIO_RGPIO_OUT |
`GPIO_RGPIO_OUT: begin |
wb_dat[dw-1:0] = rgpio_out; |
end |
`endif |
`ifdef GPIO_RGPIO_OE |
`GPIO_RGPIO_OE: begin |
wb_dat[dw-1:0] = ~rgpio_oe; |
wb_dat[dw-1:0] = rgpio_oe; |
end |
`endif |
`ifdef GPIO_RGPIO_INTE |
`GPIO_RGPIO_INTE: begin |
wb_dat[dw-1:0] = rgpio_inte; |
end |
`endif |
`ifdef GPIO_RGPIO_PTRIG |
`GPIO_RGPIO_PTRIG: begin |
wb_dat[dw-1:0] = rgpio_ptrig; |
end |
`endif |
`ifdef GPIO_RGPIO_NEC |
`GPIO_RGPIO_NEC: begin |
wb_dat[dw-1:0] = rgpio_nec; |
end |
`endif |
`ifdef GPIO_RGPIO_ECLK |
`GPIO_RGPIO_ECLK: begin |
wb_dat[dw-1:0] = rgpio_eclk; |
end |
`endif |
`ifdef GPIO_RGPIO_AUX |
`GPIO_RGPIO_AUX: begin |
wb_dat[dw-1:0] = rgpio_aux; |
end |
`endif |
`ifdef GPIO_RGPIO_CTRL |
`GPIO_RGPIO_CTRL: begin |
wb_dat[1:0] = rgpio_ctrl; |
wb_dat[dw-1:2] = {dw-2{1'b0}}; |
end |
`endif |
`endif |
`ifdef GPIO_RGPIO_INTS |
`GPIO_RGPIO_INTS: begin |
wb_dat[dw-1:0] = rgpio_ints; |
end |
`endif |
default: begin |
wb_dat[dw-1:0] = rgpio_in; |
end |
1504,7 → 1541,7
// |
// Output enables are RGPIO_OE bits |
// |
assign ext_padoen_o = rgpio_oe; |
assign ext_padoe_o = rgpio_oe; |
|
// |
// Generate GPIO outputs |
1533,7 → 1570,7
assign wb_inta_o = 1'b0; |
assign wb_ack_o = 1'b0; |
assign wb_err_o = wb_cyc_i & wb_stb_i; |
assign ext_padoen_o = {gw{1'b1}}; |
assign ext_padoe_o = {gw{1'b1}}; |
assign ext_pad_o = {gw{1'b0}}; |
|
// |