Reading the repo
Opening the box…
Reading the repo
Opening the box…
Assembly instructions
A minimal Layer 2 network switch implemented in Verilog at the Register-Transfer Level (RTL), featuring FSM control logic, FIFO buffering, and hardware-based packet routing.
Saved setup from 1 h ago
Will it work on macOS?
The maintainers included run_sim.sh. Run it from the cloned folder after reading it.
bash run_sim.sh
All modules were developed and smoke-tested with Icarus Verilog. Hence requires Icarus Verilog 11 or newer to simulate the build.
./run_sim.sh # 4-port system test + MAC aging test
./run_sim.sh 8 # same system test with NUM_PORTS = 8
<div align="center">
<img src="assets/terminal.svg" alt="Animated terminal showing the regression passing" width="90%"/>
</div>
<br>
To custom instantiate the switch, change the parameters as needed
l2_switch_top #(
.NUM_PORTS (4),
.ING_FIFO_DEPTH (256),
.EGR_FIFO_DEPTH (256),
.EGR_STORE_FWD (1)
) u_switch (
.clk(clk), .rst_n_async(rst_n),
.rx_data(rx_data), .rx_sop(rx_sop), .rx_eop(rx_eop), .rx_valid(rx_valid), .rx_ready(rx_ready),
.tx_data(tx_data), .tx_sop(tx_sop), .tx_eop(tx_eop), .tx_valid(tx_valid), .tx_ready(tx_ready),
.table_ready(table_ready),
.cnt_rx_frames(), .cnt_tx_frames(), .cnt_runts(), .cnt_vlan_frames(),
.cnt_filtered(), .cnt_rx_stall(), .cnt_tx_stall()
);
Wait for table_ready (about 128 cycles at the default table size) before sending traffic.
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: xcode-select --install
git clone https://github.com/TharinduHimantha/Minimal-Network-Switch-Verilog-Implementation.git cd Minimal-Network-Switch-Verilog-Implementation
In the maintainers' order. Do the README instructions above first — they cover steps outside the terminal.
./run_sim.sh # 4-port system test + MAC aging test ./run_sim.sh 8 # same system test with NUM_PORTS = 8
No reports for macOS yet.
GitManual AI Agent reads the 1 key files and writes a step-by-step guide for macOS. Once written, it's saved for everyone.