Support ENABLE_COUNTERS in hub

It's convenient to be able to adjust this parameter if the counters ever
end up on the critical path. Support adjusting it from hub.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
This commit is contained in:
Sean Anderson 2023-03-05 20:47:46 -05:00
parent 66945f11d9
commit db4c225db5
3 changed files with 9 additions and 3 deletions

View File

@ -45,8 +45,10 @@ module top (
reg [3:0] receiving; reg [3:0] receiving;
hub #( hub #(
.WISHBONE(0), .PORT_COUNT(4),
.PORT_COUNT(4) .WISHBONE(1),
.ENABLE_COUNTERS(1),
.COUNTER_WIDTH(16)
) hub ( ) hub (
.clk_125(clk_125), .clk_125(clk_125),
.clk_250(clk_250), .clk_250(clk_250),

View File

@ -30,6 +30,7 @@ module hub (
parameter PORT_COUNT = 4; parameter PORT_COUNT = 4;
parameter ELASTIC_BUF_SIZE = 3; parameter ELASTIC_BUF_SIZE = 3;
parameter ENABLE_COUNTERS = 1; parameter ENABLE_COUNTERS = 1;
parameter COUNTER_WIDTH = 15;
parameter [23:0] OUI = 0; parameter [23:0] OUI = 0;
parameter [5:0] MODEL = 0; parameter [5:0] MODEL = 0;
parameter [3:0] REVISION = 0; parameter [3:0] REVISION = 0;
@ -95,6 +96,7 @@ module hub (
phy_internal #( phy_internal #(
.WISHBONE(WISHBONE), .WISHBONE(WISHBONE),
.ENABLE_COUNTERS(ENABLE_COUNTERS), .ENABLE_COUNTERS(ENABLE_COUNTERS),
.COUNTER_WIDTH(COUNTER_WIDTH),
.OUI(OUI), .OUI(OUI),
.MODEL(MODEL), .MODEL(MODEL),
.REVISION(REVISION) .REVISION(REVISION)

View File

@ -47,6 +47,7 @@ module phy_internal (
parameter WISHBONE = 1; parameter WISHBONE = 1;
parameter ENABLE_COUNTERS = 1; parameter ENABLE_COUNTERS = 1;
parameter COUNTER_WIDTH = 15;
parameter [23:0] OUI = 0; parameter [23:0] OUI = 0;
parameter [5:0] MODEL = 0; parameter [5:0] MODEL = 0;
parameter [3:0] REVISION = 0; parameter [3:0] REVISION = 0;
@ -100,7 +101,8 @@ module phy_internal (
.MODEL(MODEL), .MODEL(MODEL),
.REVISION(REVISION), .REVISION(REVISION),
.EMULATE_PULLUP(1'b1), .EMULATE_PULLUP(1'b1),
.ENABLE_COUNTERS(ENABLE_COUNTERS) .ENABLE_COUNTERS(ENABLE_COUNTERS),
.COUNTER_WIDTH(COUNTER_WIDTH)
) mdio_regs ( ) mdio_regs (
.clk(clk_125), .clk(clk_125),
.ack(wb_ack), .ack(wb_ack),