Header menu logo issie

ErrorCheck Module

Functions and values

Function or value Description

checkAllOutputsAssigned ast portMap portSizeMap linesLocations errorList

Full Usage: checkAllOutputsAssigned ast portMap portSizeMap linesLocations errorList

Parameters:
Returns: ErrorInfo list

Checks if all declared output ports have a value assigned to them The check is done bit-by-bit

ast : VerilogInput
portMap : Map<string, string>
portSizeMap : Map<string, int>
linesLocations : int list
errorList : ErrorInfo list
Returns: ErrorInfo list

checkAssignmentWidths ast linesLocations portSizeMap wireSizeMap errorList

Full Usage: checkAssignmentWidths ast linesLocations portSizeMap wireSizeMap errorList

Parameters:
    ast : VerilogInput
    linesLocations : int list
    portSizeMap : Map<string, int>
    wireSizeMap : Map<string, int>
    errorList : ErrorInfo list

Returns: ErrorInfo list

Checks if the RHS expression is wider than the LHS of an assignment. Checks every assignment: continuous and combinational

ast : VerilogInput
linesLocations : int list
portSizeMap : Map<string, int>
wireSizeMap : Map<string, int>
errorList : ErrorInfo list
Returns: ErrorInfo list

checkIODeclarations ast portWidthDeclarationMap portLocationMap linesLocations nonUniquePortDeclarations portMap project errorList

Full Usage: checkIODeclarations ast portWidthDeclarationMap portLocationMap linesLocations nonUniquePortDeclarations portMap project errorList

Parameters:
    ast : VerilogInput
    portWidthDeclarationMap : Map<string, (int * int)>
    portLocationMap : Map<string, int>
    linesLocations : int list
    nonUniquePortDeclarations : string list
    portMap : Map<string, string>
    project : Project
    errorList : ErrorInfo list

Returns: ErrorInfo list

Checks whether all ports defined as input/output are declared as ports in the module header Also checks for double definitions and for input ports not used in the assignments

ast : VerilogInput
portWidthDeclarationMap : Map<string, (int * int)>
portLocationMap : Map<string, int>
linesLocations : int list
nonUniquePortDeclarations : string list
portMap : Map<string, string>
project : Project
errorList : ErrorInfo list
Returns: ErrorInfo list

checkIOWidthDeclarations ast linesLocations errorList

Full Usage: checkIOWidthDeclarations ast linesLocations errorList

Parameters:
Returns: ErrorInfo list

Checks whether the IO declarations have correct width format (i.e. Little-endian)

ast : VerilogInput
linesLocations : int list
errorList : ErrorInfo list
Returns: ErrorInfo list

checkInputsAssigned ast linesLocations portMap errorInfoList

Full Usage: checkInputsAssigned ast linesLocations portMap errorInfoList

Parameters:
Returns: ErrorInfo list
ast : VerilogInput
linesLocations : int list
portMap : Map<string, string>
errorInfoList : ErrorInfo list
Returns: ErrorInfo list

checkUnsupportedKeywords ast linesLocations errorList

Full Usage: checkUnsupportedKeywords ast linesLocations errorList

Parameters:
Returns: ErrorInfo list
ast : VerilogInput
linesLocations : int list
errorList : ErrorInfo list
Returns: ErrorInfo list

checkWiresAndAssignments ast portMap portSizeMap portWidthDeclarationMap inputNameList linesLocations wireNameList wireSizeMap wireLocationMap errorList

Full Usage: checkWiresAndAssignments ast portMap portSizeMap portWidthDeclarationMap inputNameList linesLocations wireNameList wireSizeMap wireLocationMap errorList

Parameters:
    ast : VerilogInput
    portMap : Map<string, string>
    portSizeMap : Map<string, int>
    portWidthDeclarationMap : Map<string, (int * int)>
    inputNameList : string list
    linesLocations : int list
    wireNameList : string list
    wireSizeMap : Map<string, int>
    wireLocationMap : Map<string, int>
    errorList : ErrorInfo list

Returns: ErrorInfo list

Checks one-by-one all wire and output port assignments for: 1) LHS Name and Width 2) RHS Names 3) RHS Width of inputs/wires 4) Width LHS = Width RHS

ast : VerilogInput
portMap : Map<string, string>
portSizeMap : Map<string, int>
portWidthDeclarationMap : Map<string, (int * int)>
inputNameList : string list
linesLocations : int list
wireNameList : string list
wireSizeMap : Map<string, int>
wireLocationMap : Map<string, int>
errorList : ErrorInfo list
Returns: ErrorInfo list

createErrorMessage newLinesLocations currLocation message extraMessages name

Full Usage: createErrorMessage newLinesLocations currLocation message extraMessages name

Parameters:
    newLinesLocations : int list
    currLocation : int
    message : string
    extraMessages : ExtraErrorInfo array
    name : string

Returns: ErrorInfo list

Helper function to create an ErrorInfo-type Error Message given the location, the variable name, and the message

newLinesLocations : int list
currLocation : int
message : string
extraMessages : ExtraErrorInfo array
name : string
Returns: ErrorInfo list

getInputNames portMap

Full Usage: getInputNames portMap

Parameters:
    portMap : Map<'a, string>

Returns: 'a list

Returns the names of the ports declared as INPUT

portMap : Map<'a, string>
Returns: 'a list

getInputSizeMap inputNameList portSizeMap

Full Usage: getInputSizeMap inputNameList portSizeMap

Parameters:
    inputNameList : 'a list
    portSizeMap : Map<'a, 'b>

Returns: Map<'a, 'b>
inputNameList : 'a list
portSizeMap : Map<'a, 'b>
Returns: Map<'a, 'b>

getNotUniquePortDeclarations items

Full Usage: getNotUniquePortDeclarations items

Parameters:
Returns: string list
items : ItemT list
Returns: string list

getPortMap items

Full Usage: getPortMap items

Parameters:
Returns: Map<string, string>

Returns the port-type map (e.g. (port "a" => INPUT))

items : ItemT list
Returns: Map<string, string>

getPortSizeAndLocationMap items

Full Usage: getPortSizeAndLocationMap items

Parameters:
Returns: Map<string, int> * Map<string, int>

Returns the port-size map (e.g. (port "a" => 4 bits wide))

items : ItemT list
Returns: Map<string, int> * Map<string, int>

getPortWidthDeclarationMap items

Full Usage: getPortWidthDeclarationMap items

Parameters:
Returns: Map<string, (int * int)>

Returns the port-width declaration map (e.g. ( port "a" => (4,0) ))

items : ItemT list
Returns: Map<string, (int * int)>

getSemanticErrors ast linesLocations origin project

Full Usage: getSemanticErrors ast linesLocations origin project

Parameters:
Returns: ErrorInfo list

Main error-finder function Returns a list of errors (type ErrorInfo)

ast : VerilogInput
linesLocations : int list
origin : CodeEditorOpen
project : Project
Returns: ErrorInfo list

getWireLocationMap items

Full Usage: getWireLocationMap items

Parameters:
Returns: Map<string, int>
items : ItemT list
Returns: Map<string, int>

getWireNames items

Full Usage: getWireNames items

Parameters:
Returns: string list
items : ItemT list
Returns: string list

getWireSizeMap items

Full Usage: getWireSizeMap items

Parameters:
Returns: Map<string, int>

Returns the names of the declared WIRES

items : ItemT list
Returns: Map<string, int>

nameCheck ast linesLocations origin project errorList

Full Usage: nameCheck ast linesLocations origin project errorList

Parameters:
Returns: ErrorInfo list

Checks if the name of the module is valid (i.e. this sheet doesn't exist)

ast : VerilogInput
linesLocations : int list
origin : CodeEditorOpen
project : Project
errorList : ErrorInfo list
Returns: ErrorInfo list

portCheck ast linesLocations errorList

Full Usage: portCheck ast linesLocations errorList

Parameters:
Returns: ErrorInfo list

Checks whether all ports given in the beginning of the module are defined as input/output Also if all ports have distinct names

ast : VerilogInput
linesLocations : int list
errorList : ErrorInfo list
Returns: ErrorInfo list

unaryTreeToString treeDepth targetLength unary

Full Usage: unaryTreeToString treeDepth targetLength unary

Parameters:
    treeDepth : int
    targetLength : int
    unary : OneUnary

Returns: string

Helper recursive function to transform the produced OneUnary-type tree by RHSUnaryAnalysis to a string which can be used for ErrorInfo

treeDepth : int
targetLength : int
unary : OneUnary
Returns: string

Type something to start searching.