Header menu logo issie

ErrorCheckHelpers Module

Types

Type Description

ExpressionNode

Functions and values

Function or value Description

RHSUnaryAnalysis assignmentRHS inputWireSizeMap

Full Usage: RHSUnaryAnalysis assignmentRHS inputWireSizeMap

Parameters:
Returns: OneUnary

Helper function used by checkWidthOfAssignment with 3 recursive subfunctions Returns the RHS Unary Size tree of type OneUnary where OneUnary = {Name:string;ResultWidth:int;Head:OneUnary option;Tail:OneUnary option;Elements:OneUnary list}

assignmentRHS : ExpressionT
inputWireSizeMap : Map<string, int>
Returns: OneUnary

checkExpr linesLocations currentInputWireSizeMap localErrors expr

Full Usage: checkExpr linesLocations currentInputWireSizeMap localErrors expr

Parameters:
    linesLocations : int list
    currentInputWireSizeMap : Map<string, int>
    localErrors : ErrorInfo list
    expr : ExpressionT

Returns: ErrorInfo list
linesLocations : int list
currentInputWireSizeMap : Map<string, int>
localErrors : ErrorInfo list
expr : ExpressionT
Returns: ErrorInfo list

checkNumber linesLocations num

Full Usage: checkNumber linesLocations num

Parameters:
    linesLocations : int list
    num : NumberT

Returns: ErrorInfo list
linesLocations : int list
num : NumberT
Returns: ErrorInfo list

checkPrimariesWidths linesLocations currentInputWireSizeMap localErrors primariesRHS

Full Usage: checkPrimariesWidths linesLocations currentInputWireSizeMap localErrors primariesRHS

Parameters:
    linesLocations : int list
    currentInputWireSizeMap : Map<string, int>
    localErrors : ErrorInfo list
    primariesRHS : PrimaryT list

Returns: ErrorInfo list

Check if the width of each wire/input used is within the correct range (defined range)

linesLocations : int list
currentInputWireSizeMap : Map<string, int>
localErrors : ErrorInfo list
primariesRHS : PrimaryT 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

findCloseVariable variable portAndWireNames

Full Usage: findCloseVariable variable portAndWireNames

Parameters:
    variable : char seq
    portAndWireNames : string list

Returns: string list

Helper function to find the closest port or wire name Used by checkNamesOnRHSOfAssignment Gives an appropriate suggestion if the wrong name is close to a name in the list

variable : char seq
portAndWireNames : string list
Returns: string list

getAlwaysBlocksWithLocations alwaysBlocks node

Full Usage: getAlwaysBlocksWithLocations alwaysBlocks node

Parameters:
Returns: (AlwaysConstructT * int) list
alwaysBlocks : (AlwaysConstructT * int) list
node : ASTNode
Returns: (AlwaysConstructT * int) list

getCaseItemNums nums node

Full Usage: getCaseItemNums nums node

Parameters:
Returns: NumberT list
nums : NumberT list
node : ASTNode
Returns: NumberT list

getCaseStatements caseStatements node

Full Usage: getCaseStatements caseStatements node

Parameters:
Returns: CaseStatementT list
caseStatements : CaseStatementT list
node : ASTNode
Returns: CaseStatementT list

getCaseStatementsWithLoc caseStatements node

Full Usage: getCaseStatementsWithLoc caseStatements node

Parameters:
Returns: (CaseStatementT * int) list
caseStatements : (CaseStatementT * int) list
node : ASTNode
Returns: (CaseStatementT * int) list

getCondAndCaseExpressions expressions node

Full Usage: getCondAndCaseExpressions expressions node

Parameters:
Returns: (ExpressionT * int) list
expressions : (ExpressionT * int) list
node : ASTNode
Returns: (ExpressionT * int) list

getDeclarations declarations node

Full Usage: getDeclarations declarations node

Parameters:
Returns: DeclarationT list
declarations : DeclarationT list
node : ASTNode
Returns: DeclarationT list

getLHSBits portSizeMap assignment

Full Usage: getLHSBits portSizeMap assignment

Parameters:
Returns: (string * string) list

replace this later with getLHSBits'!

portSizeMap : Map<string, int>
assignment : AssignmentT
Returns: (string * string) list

getLHSBits' portSizeMap assignment

Full Usage: getLHSBits' portSizeMap assignment

Parameters:
Returns: string list

returns all the bits of the lhs of an assignment the strings returned are unique, index surrounded by "[]" is appended to the name of the variable

portSizeMap : Map<string, int>
assignment : AssignmentT
Returns: string list

getLHSBitsAssignedCertainly portSizeMap assignment

Full Usage: getLHSBitsAssignedCertainly portSizeMap assignment

Parameters:
Returns: string list

returns each bit of an assignment LHS. In the case of variable indexing, no bits are returned

portSizeMap : Map<string, int>
assignment : AssignmentT
Returns: string list

getLHSWidth assign varSizeMap

Full Usage: getLHSWidth assign varSizeMap

Parameters:
Returns: int
assign : AssignmentT
varSizeMap : Map<string, int>
Returns: int

getLineNumber linesLocations location

Full Usage: getLineNumber linesLocations location

Parameters:
    linesLocations : int list
    location : int

Returns: int

return line number based on location

linesLocations : int list
location : int
Returns: int

getModuleInstantiationInputPrimaries modInst project

Full Usage: getModuleInstantiationInputPrimaries modInst project

Parameters:
Returns: PrimaryT list

Input primaries

modInst : ModuleInstantiationT
project : Project
Returns: PrimaryT list

getModuleInstantiationOutputPrimaries modInst project

Full Usage: getModuleInstantiationOutputPrimaries modInst project

Parameters:
Returns: PrimaryT list

Output primaries

modInst : ModuleInstantiationT
project : Project
Returns: PrimaryT list

getModuleInstantiationStatements moduleInstantiations node

Full Usage: getModuleInstantiationStatements moduleInstantiations node

Parameters:
Returns: ModuleInstantiationT list
moduleInstantiations : ModuleInstantiationT list
node : ASTNode
Returns: ModuleInstantiationT list

getPrimaryBits portSizeMap primary

Full Usage: getPrimaryBits portSizeMap primary

Parameters:
Returns: string list
portSizeMap : Map<string, int>
primary : PrimaryT
Returns: string list

getRHSBits portSizeMap expression

Full Usage: getRHSBits portSizeMap expression

Parameters:
Returns: Set<string>

make sure to include variables AND ports in portSizeMap

portSizeMap : Map<string, int>
expression : ExpressionT
Returns: Set<string>

getWidthOfExpr assignmentRHS inputWireSizeMap

Full Usage: getWidthOfExpr assignmentRHS inputWireSizeMap

Parameters:
Returns: int
assignmentRHS : ExpressionT
inputWireSizeMap : Map<string, int>
Returns: int

primariesUsedInAssignment inLst tree

Full Usage: primariesUsedInAssignment inLst tree

Parameters:
Returns: PrimaryT list

Recursive function to get all the primaries used in the RHS of an assignment Used by checkNamesOnRHSOfAssignment and checkSizesOnRHSOfAssignment

inLst : PrimaryT list
tree : ExpressionT
Returns: PrimaryT list

Type something to start searching.