Menu

Module

StackSmith

[Table Of Contents] Module [Instance] [Wiring]

Module

Modules are units of FPGAsm code. A module definition consists of the module header and the body.

<name>(<paramnames>) [input:(<inpins>)] [output:(<outpins>)] {
...instances...
...wires...
}

name is the name of the module. Like all identifiers, it must start with an alpha character and contain alphanumeric characters or _'s. The name of the module is used as the 'type' in instance declarations.

paramnames is the parameter name list containing zero or more parameter names, separated by commas. Each parameter may optionally declare a default value preceded by a colon. For example: (parm1,parm2:0x100,parm3).

Instances of this type have to set the values of all parameters that do not have a default value, and may set the values of parameters that have a default value.

inpins and outpins are comma-separated names of input and output pins, respectively. Modules that do not have any inputs may omit the entire input:(..) clause, same goes for outputs. The top module, for example, has no input or output pins as its sole purpose is to contain other modules and not be instantiated inside other modules.

Inside the module body there are instance declarations and wiring connecting the pins of the module itself and its instances.

[Table Of Contents] Module [Instance] [Wiring]


Related

Wiki: Instance
Wiki: Table Of Contents
Wiki: Wiring

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.