hwtLib.samples.builders package

Submodules

hwtLib.samples.builders.ethAddrUpdater module

class hwtLib.samples.builders.ethAddrUpdater.EthAddrUpdater[source]

Bases: hwt.synthesizer.unit.Unit

This is example unit which reads dst and src addresses(MAC and IPv4) from ethernet frame stored in memory and writes this addresses in reverse direction into second frame.

_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance
  • called in __init__ of class
_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)
  • _declr method is called after _config
  • if this object is Unit all interfaces are threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr

hwtLib.samples.builders.handshakedBuilderSimple module

class hwtLib.samples.builders.handshakedBuilderSimple.HandshakedBuilderSimple[source]

Bases: hwt.synthesizer.unit.Unit

Simple example of HsBuilder which can build components for Handshaked interfaces

_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)
  • _declr method is called after _config
  • if this object is Unit all interfaces are threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
class hwtLib.samples.builders.handshakedBuilderSimple.HandshakedBuilderSimpleTC(methodName='runTest')[source]

Bases: hwt.simulator.simTestCase.SimTestCase

test_passData()[source]

hwtLib.samples.builders.hsBuilderSplit module

class hwtLib.samples.builders.hsBuilderSplit.HsBuilderSplit[source]

Bases: hwt.synthesizer.unit.Unit

Example of HsBuilder.split_* functions

_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)
  • _declr method is called after _config
  • if this object is Unit all interfaces are threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr

hwtLib.samples.builders.pingResponder module

class hwtLib.samples.builders.pingResponder.PingResponder[source]

Bases: hwt.synthesizer.unit.Unit

Listen for echo request on rx axi stream interface and respond with echo response on tx interface

Note:incoming checksum is not checked
Attention:you have to ping “ping -s 0 <ip>” because unit ignores additional data in packet and linux by defaults adds it
_config()[source]

Configure object parameters

  • setup all parameters on this object, use Param class instances to allow use of parameter inheritance
  • called in __init__ of class
_declr()[source]

declarations

  • do all declarations of externally accessible objects there (Interfaces)
  • _declr method is called after _config
  • if this object is Unit all interfaces are threaten as externally accessible interfaces if this object is Interface all subinterfaces are loaded
_impl()[source]

implementations

  • implement functionality of design there
  • called after _declr
connect_resp(resp, forgeIn, sendingReply)[source]

Connect response data on inputs of frame forge

Parameters:
  • resp – registers with response data
  • forgeIn – input interface of frame forge
  • sendingRepply – flag which signalizes that data should be forged into frame and send
icmp_checksum(header)[source]
Note:we do not need to care about endianity because parser/forge will swap it for us and we can work with little endians only
Returns:checksum for icmp header
req_load(parsed, regs, freeze)[source]

Load request from parser input into registers

Parameters:
  • parsed – input interface with parsed fields of ICPM frame
  • regs – registers for ICMP frame
  • freeze – signal to freeze value in registers
  • defVal – dictionary item from regs: default value
Attention:

dst and src are swapped

Module contents