Livt packages
Livt.IO
Version 1.8.1
Memory, UART, I2C, SPI, and Ethernet input/output components for Livt hardware designs.
Published files (126)
- phy
- EthernetCrc.lvt
- EthernetReceiver.lvt
- EthernetResult.lvt
- EthernetTransmitter.lvt
- IEthernetLinkStatus.lvt
- IEthernetMedia.lvt
- IEthernetReceiver.lvt
- IEthernetTransmitter.lvt
- IMdioController.lvt
- IMdioPins.lvt
- IMiiPins.lvt
- IRmiiPins.lvt
- MdioController.lvt
- MiiAdapter.lvt
- MiiClearEndpoint.lvt
- MiiClockBridge.lvt
- MiiCompletionReceiver.lvt
- MiiFifoStorage.lvt
- MiiReadBuffer.lvt
- MiiReceiver.lvt
- MiiTransmitter.lvt
- RmiiAdapter.lvt
src/ethernet/EthernetCrc.lvt
namespace Livt.IO
/** Reflected Ethernet CRC-32; initial all ones, complemented little-endian FCS. */
component EthernetCrc
{
public static fn Update[](crc: logic[32], value: byte) logic[32]
{
var next = crc ^ ((value as uint) as logic[32])
for (var bit = 0; bit < 8; bit++) {
if ((next & 0x00000001) != 0x00000000) {
next = (next >> 1) ^ 0xEDB88320
} else {
next = next >> 1
}
}
return next
}
public static fn SupportedType[](high: byte, low: byte) bool
{
return high >= 0x06 && !(high == 0x81 && low == 0x00)
&& !(high == 0x88 && low == 0xA8)
}
}