Header menu logo issie

Verilog Module

Types

Type Description

CompilationProfile

VMode

Functions and values

Function or value Description

activeComps fs

Full Usage: activeComps fs

Parameters:
Returns: FastComponent array
fs : FastSimulation
Returns: FastComponent array

fastOutputDefinition vType fc opn

Full Usage: fastOutputDefinition vType fc opn

Parameters:
Returns: string

what verilog declaration should the output signal have?

vType : VMode
fc : FastComponent
opn : OutputPortNumber
Returns: string

getDebugController profile fs

Full Usage: getDebugController profile fs

Parameters:
Returns: string[]
profile : CompilationProfile
fs : FastSimulation
Returns: string[]

getInitialSimulationBlock vType fs

Full Usage: getInitialSimulationBlock vType fs

Parameters:
Returns: string[]

make a simple testbench which displays module outputs for the first 30 clock cycles

vType : VMode
fs : FastSimulation
Returns: string[]

getInstantiatedModules profile fs

Full Usage: getInstantiatedModules profile fs

Parameters:
Returns: string array

get all the RAM and ROM modules used NB at the moment each instance is made a separately named module, for simplicity

profile : CompilationProfile
fs : FastSimulation
Returns: string array

getMainHardware fs

Full Usage: getMainHardware fs

Parameters:
Returns: string array

get the verilog statements output from each component NB a hybrid component (AsyncRAM1) is in both FClockedComps and FOrderedComps, since it has both clocked and combinational behaviour. Its Verilog describes the whole component, so it must be written once: activeComps drops the hybrid copy from the combinational half.

fs : FastSimulation
Returns: string array

getMainHeader vType profile fs

Full Usage: getMainHeader vType profile fs

Parameters:
Returns: string[]

return the header of the main verilog module with hardware inputs and outputs in header.

vType : VMode
profile : CompilationProfile
fs : FastSimulation
Returns: string[]

getMainSignalDefinitions vType profile fs

Full Usage: getMainSignalDefinitions vType profile fs

Parameters:
Returns: string array

return the wire and reg definitions needed to make the verilog design work.

vType : VMode
profile : CompilationProfile
fs : FastSimulation
Returns: string array

getVPortInput fs fc arg3

Full Usage: getVPortInput fs fc arg3

Parameters:
Returns: string

Get string corresponding to name of signal that drives component input port

fs : FastSimulation
fc : FastComponent
arg2 : InputPortNumber
Returns: string

getVPortOut fc arg2

Full Usage: getVPortOut fc arg2

Parameters:
Returns: string

get output port name

fc : FastComponent
arg1 : OutputPortNumber
Returns: string

getVPortOutWithSlice fc opn

Full Usage: getVPortOutWithSlice fc opn

Parameters:
Returns: string

Get string corresponding to output port name with its width prepended as a Verilog slice. All output ports are internal wire or reg definitions.

fc : FastComponent
opn : OutputPortNumber
Returns: string

getVerilog vType fs profile

Full Usage: getVerilog vType fs profile

Parameters:
Returns: string

Outputs a string which contains a single verilog file with the hardware in verilog form. The top-level simulation moudle is called main - other modules may be included for RAM & ROM this can be called any time after after buildFastSimulation has created the initial FastSimulation data structure. To simulate this you would need to set up clk as a clock input, and provide stimulus for other inputs if there are any.

vType : VMode
fs : FastSimulation
profile : CompilationProfile
Returns: string

getVerilogComponent fs fc

Full Usage: getVerilogComponent fs fc

Parameters:
Returns: string

Translates from a component to its Verilog description

fs : FastSimulation
fc : FastComponent
Returns: string

getVerilogGateOp gateType

Full Usage: getVerilogGateOp gateType

Parameters:
Returns: string

The bitwise operator a gate combines its inputs with, before any inversion. Gate inputs are always one bit wide, so the bitwise operators are the right ones.

gateType : GateComponentType
Returns: string

getVerilogNInputBinaryOp cType portConversionFn

Full Usage: getVerilogNInputBinaryOp cType portConversionFn

Parameters:
Returns: string

Implement an n-input gate. The inputs are combined with the un-negated operator and the result inverted once, which is what an n-input NAND/NOR/XNOR gate means, and what getNInpBinaryGateReducer in EvalReference does. Folding the negated operator pairwise instead would give different logic for n > 2.

cType : ComponentType
portConversionFn : int -> string
Returns: string

getZeros width

Full Usage: getZeros width

Parameters:
    width : int

Returns: string

Create fixed width verilog zero. NB it seems this is not strictly needed, integer 0 works!

width : int
Returns: string

makeAsyncRamModule moduleName mem

Full Usage: makeAsyncRamModule moduleName mem

Parameters:
    moduleName : string
    mem : Memory1

Returns: string
moduleName : string
mem : Memory1
Returns: string

makeAsyncRomModule moduleName mem

Full Usage: makeAsyncRomModule moduleName mem

Parameters:
    moduleName : string
    mem : Memory1

Returns: string
moduleName : string
mem : Memory1
Returns: string

makeBits w c

Full Usage: makeBits w c

Parameters:
    w : int32
    c : bigint

Returns: string

get valid Verilog constant for bus of given width (may be 1) NB the digits must be hex, since they follow a 'h prefix: %A or %d would print the value in decimal and Verilog would then read those digits as hex, giving a different (and too wide) number. printf "%x" does not work on bigints, hence hexBignum.

w : int32
c : bigint
Returns: string

makeRamModule moduleName mem

Full Usage: makeRamModule moduleName mem

Parameters:
    moduleName : string
    mem : Memory1

Returns: string
moduleName : string
mem : Memory1
Returns: string

makeRomModule moduleName mem

Full Usage: makeRomModule moduleName mem

Parameters:
    moduleName : string
    mem : Memory1

Returns: string
moduleName : string
mem : Memory1
Returns: string

memInstanceName fc

Full Usage: memInstanceName fc

Parameters:
Returns: string

Name of the single instance of that module. Derived from the component name, which writeVerilogNames has already made unique, so instances cannot collide either.

fc : FastComponent
Returns: string

memModuleName fc

Full Usage: memModuleName fc

Parameters:
Returns: string

Name of the module generated for a memory component. Distinct from the component's own name, which is already in use as the net driven by the instance: a module and a net sharing an identifier is legal in some tools and rejected by others.

fc : FastComponent
Returns: string

removeHybridComps fa

Full Usage: removeHybridComps fa

Parameters:
Returns: FastComponent array
fa : FastComponent array
Returns: FastComponent array

verilogNameConvert maxChars s

Full Usage: verilogNameConvert maxChars s

Parameters:
    maxChars : int
    s : string

Returns: string

take FullName and convert it into a verilog compatible form this is not 1-1, so outputs may not be unique, that is OK

maxChars : int
s : string
Returns: string

writeVerilogNames fs

Full Usage: writeVerilogNames fs

Parameters:

simple way to assign to each component and component output a unique verilog compatible name. outputs will become reg or wire signals in the Verilog

fs : FastSimulation

Type something to start searching.