Xilinx UG194 Virtex-5 FPGA Embedded Tri-Mode Ethernet MAC ...
Xilinx UG194 Virtex-5 FPGA Embedded Tri-Mode Ethernet MAC ...
Xilinx UG194 Virtex-5 FPGA Embedded Tri-Mode Ethernet MAC ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 4: Host/DCR Bus Interfaces<br />
// Poll the RDYstatus_e1 register<br />
while ( !(dcr_read(E<strong>MAC</strong>1_DCRBASEADDR + 3) & 0x00010000) );<br />
Reading from the General Address Table Register of the Address Filter Block<br />
The same methods used in reading and writing to the <strong>Ethernet</strong> <strong>MAC</strong> configuration<br />
registers through the DCR apply to the address filter configuration registers. The only<br />
operations that differ are reading and writing from the general address table.<br />
To read the desired general address table register of the address filter, a DCR write<br />
operation must be performed.<br />
1. Write to the dataRegLSW register, setting the two-bit address of the general address<br />
table of the register to be accessed (four general address table registers are in the<br />
address filter block) and the RNW bit to 1.<br />
2. Write to the cntlReg register with the address register of general address (Word 1) to<br />
0x38C. Set the Write enable bit to write to the general address (Word 1) (see<br />
Table 4-12). Use E<strong>MAC</strong>0_DCRBASEADDR to access E<strong>MAC</strong>0 and<br />
E<strong>MAC</strong>1_DCRBASEADDR to access E<strong>MAC</strong>1.<br />
3. Poll the RDYstatus_e# register until the address filter Read-Ready bit is set to 1 or wait<br />
until the DCRHOSTDONEIR interrupt is asserted.<br />
4. Read from the dataRegMSW to read the general address [47:32] and dataRegLSW to<br />
read general address [31:0].<br />
To read from the general address table register (2) of E<strong>MAC</strong>0:<br />
// MULTI_ADDR Register 2 of AF Block<br />
// Set the enable bit of the MULTI_ADDR RNW and MULTI_ADDR Register 2<br />
dcr_write(E<strong>MAC</strong>0_DCRBASEADDR + 1, 0x00820000);<br />
// Write the address of E<strong>MAC</strong>0 General Address register to the cntlReg<br />
// register, with the write enable bit asserted<br />
dcr_write(E<strong>MAC</strong>0_DCRBASEADDR + 2, 0x0000838C);<br />
// Poll the RDYstatus_e0 register<br />
while ( !(dcr_read(E<strong>MAC</strong>0_DCRBASEADDR + 3) & 0x00010000) );<br />
// Read the values returned of the General Address Word0 and Word1<br />
// registers (48-bit value)<br />
// from the dataRegMSW and dataRegLSW registers<br />
gen_addr_msw = dcr_read(E<strong>MAC</strong>0_DCRBASEADDR + 0);<br />
gen_addr_lsw = dcr_read(E<strong>MAC</strong>0_DCRBASEADDR + 1);<br />
Writing to the General Address Table Register of the Address Filter Block<br />
The same methods used in reading and writing to the <strong>Ethernet</strong> <strong>MAC</strong> configuration<br />
registers through the DCR apply to the address filter configuration registers. The only<br />
operations that differ are reading and writing from the general address table.<br />
For writing to the desired general address table register of the AF block, two write<br />
operations must be performed:<br />
1. Write to the dataRegLSW register the general address [31:0] to be stored on the desired<br />
general address table register.<br />
2. Write to the cntlReg# register with the address for general address word 0 (0x388),<br />
setting the write enable bit. Use E<strong>MAC</strong>0_DCRBASEADDR to access E<strong>MAC</strong>0 and<br />
E<strong>MAC</strong>1_DCRBASEADDR to access E<strong>MAC</strong>1.<br />
3. Poll the RDYstatus_e# register until the address configuration write bit is set to 1.<br />
110 www.xilinx.com TE<strong>MAC</strong> User Guide<br />
<strong>UG194</strong> (v1.10) February 14, 2011<br />
R