ethernet part19
vn dv pathshala
0:00 / 0:00
ethernet part19
4 просмотра · 1 дн. назад
vn dv pathshala
212 подписчиков
4 просмотра · 1 дн. назад
The opencores_eth_starter module is a simplified starter implementation of a 10/100 Mbps Ethernet MAC controller interface, designed to demonstrate basic processor access through a WISHBONE slave bus, configuration and status register handling, buffer descriptor RAM access, basic MII receive activity observation, and simplified PHY management clock generation. The module uses a 32-bit WISHBONE address and data interface, with wb_clk_i as the system clock and an active-high asynchronous reset wb_rst_i; the processor initiates register or descriptor transactions using wb_cyc_i, wb_stb_i, wb_we_i, wb_adr_i, wb_dat_i, and wb_sel_i, while the controller returns read data through wb_dat_o and acknowledges accepted requests using wb_ack_o. The internal register bank provides Ethernet configuration and control registers, including MODER at address 0x00 for operating-mode configuration, INT_SOURCE at 0x04 for interrupt-status clearing using write-one-to-clear behavior, INT_MASK at 0x08 for interrupt masking, IPGT at 0x0C for inter-packet gap configuration, PACKETLEN at 0x18 for packet-length settings, TX_BD_NUM at 0x20 for configuring the number of transmit buffer descriptors, and MIIMODER at 0x28 for PHY management configuration. During reset, these registers are initialized to defined values: most are cleared, IPGT is set to 96, PACKETLEN to 0x004005EE, TX_BD_NUM to 64, and MIIMODER to 100. The WISHBONE register logic supports byte-selective writes to MODER through wb_sel_i, full-word writes to the other implemented registers, and readback of their stored values; the transmit descriptor count is limited to a maximum of 128. In addition to the configuration registers, the design declares separate 128-entry, 32-bit transmit and receive descriptor RAM arrays, representing storage for the two 32-bit words of each 64-bit descriptor, with a nominal byte-address range of 0x400 to 0x7FF. Descriptor addresses are converted into descriptor indices and word offsets to select the corresponding RAM entry, although the present implementation only meaningfully writes the first transmit descriptor word and does not correctly implement complete two-word descriptor access, receive descriptors, or functional DMA operation. On the receive side, the module accepts a simplified four-bit MII interface consisting of mii_rxd, mii_rx_dv, and mii_rx_er, along with the independent receive clock mii_rx_clk; its current receive logic merely increments rx_nibble_count on each receive-clock edge while mii_rx_dv is asserted, allowing it to observe receive activity without decoding Ethernet frames, checking frame boundaries, calculating CRC, or storing received packets. On the transmit side, mii_txd, mii_tx_en, and mii_tx_er are reset and continuously driven to zero, so the module does not actually transmit Ethernet frames or implement the Ethernet transmit MAC state machine. The PHY management interface includes an mdc output and an mdio bidirectional signal; mdc is generated by toggling on every WISHBONE clock edge, creating a simple clock divider, while mdio is left in the high-impedance state because management transactions are not implemented. Overall, this RTL provides a basic framework for WISHBONE-controlled Ethernet MAC configuration and simple interface observation, but it is not a complete Ethernet MAC: functional transmit and receive engines, packet buffering, descriptor management, DMA, interrupt generation, and MDIO management transactions would need to be implemented before it could perform actual Ethernet communication.