GRLIB GRETH Model
The GRETH model is available in the GrEth plugin. The model needs to be combined with a MDIOBus, PHY and Ethernet model.
The GRETH model implements the behaviour of both GRETH and GRETH_GBIT.
Loading the Plugin
import BusModels
import GrEth
GRETH.new name=greth0
GenericPHY.new name=phy0
EthernetLink.new name=eth0
connect a=greth0.phy b=phy0:PHYIface
connect a=greth0.mdioBus b=phy0:MDIOIface
connect a=apbctrl0.slaves b=greth0:ApbIface
greth0.setMAC mac="00:00:00:00:00:01"
connect a=phy0.mac b=greth0:MACIface
eth0.connect device=phy0:PHYIface
Configuration
The config.gbitVariant property can be set to enable GRETH_GBIT extensions.
The extensions includes:
-
Gigabit speed.
-
IP header checksum offloading.
-
TCP checksum offloading.
-
UDP checksum offloading.
-
Scatter / gather send lists.
@GRETH Reference
Properties
| Name | Type | Description |
|---|---|---|
Class |
*void |
Class object |
Component |
*void |
Pointer to component object if part of component |
LocalName |
*char |
Local name (in component, if applicable) |
LogMessageFlags |
uint64_t |
Per-object log message suppression flags |
LoggingFlags |
uint64_t |
Flags for logging info |
Name |
*char |
Object name |
ObjectID |
uint64_t |
Unique ObjectID. |
ReplayLoggingFlags |
uint64_t |
Replay-time category logging flags |
TimeSource |
*void |
Time source object |
GRETH Reference
Properties
| Name | Type | Description |
|---|---|---|
Class |
*void |
Class object |
Component |
*void |
Pointer to component object if part of component |
ETHCTR |
uint32_t |
Ethernet Control Register |
ETHMDC |
uint32_t |
Ethernet MDIO Control and Status Register |
ETHRDP |
uint32_t |
Ethernet Receiver Descriptor Pointer Register |
ETHSIS |
uint32_t |
Ethernet Status and Interrupt Source Register |
ETHTDP |
uint32_t |
Ethernet Transmitter Descriptor Pointer Register |
LocalName |
*char |
Local name (in component, if applicable) |
LogMessageFlags |
uint64_t |
Per-object log message suppression flags |
LoggingFlags |
uint64_t |
Flags for logging info |
MACLSB |
uint32_t |
Ethernet MAC Address LSB |
MACMSB |
uint32_t |
Ethernet MAC Address MSB |
Name |
*char |
Object name |
ObjectID |
uint64_t |
Unique ObjectID. |
ReplayLoggingFlags |
uint64_t |
Replay-time category logging flags |
TimeSource |
*void |
Time source object |
config.checkCrc |
uint8_t |
Enable ethernet frame CRC checking. |
config.checkIpCrc |
uint8_t |
Enable IP header CRC checking. |
config.checkTcpCrc |
uint8_t |
Enable TCP header CRC checking. |
config.checkUdpCrc |
uint8_t |
Enable UDP header CRC checking. |
config.gbitVariant |
uint8_t |
Enable GRETH_GBIT behaviour. |
config.generateCrc |
uint8_t |
Enable ethernet frame CRC generation. |
config.irq |
uint8_t |
IRQ |
config.littleEndian |
uint8_t |
Endianess of memory interface. |
config.logTraffic |
uint8_t |
Enable traffic logging |
irqCtrl |
temu_IfaceRef/ <unknown> |
IRQ controller. |
mac |
*char |
Set MAC by string |
mdioBus |
temu_IfaceRef/ <unknown> |
MDIO bus. |
memAccess |
temu_IfaceRef/ <unknown> |
Memory access (for DMA). |
phy |
temu_IfaceRef/ <unknown> |
PHY device. |
Interfaces
| Name | Type | Description |
|---|---|---|
ApbIface |
ApbIface |
APB P&P interface |
DeviceIface |
DeviceIface |
|
MACIface |
temu::MACIface |
MAC interface |
MemAccessIface |
MemAccessIface |
Mem access interface |
RegisterIface |
temu::RegisterIface |
|
ResetIface |
ResetIface |
Registers
| Register support is currently experimental! |
Register Bank default
Register CTRL
- Description
-
Control register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register STAT
- Description
-
Status register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register MACMSB
- Description
-
MAC address MSB register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register MACLSB
- Description
-
MAC address LSB register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register MDIO
- Description
-
MDIO control and status register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register TXBASE
- Description
-
Transmitter descriptor base address register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register RXBASE
- Description
-
Receiver descriptor base address register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register EDCLIP
- Description
-
EDCL IP register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register HMSB
- Description
-
Hash table MSB register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |
Register HLSB
- Description
-
Hash table LSB register
- Reset value
-
0x00000000
- Warm reset mask
-
0x00000000
| Field | Mask | Reset | Description |
|---|---|---|---|
- |
- |
- |
- |