Skip to content

Commit

Permalink
Add support for multilength headers
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Jan 4, 2024
1 parent 3154630 commit 1d4af0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Sources/Fault/Entries/jtag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ func jtagCreate(arguments: [String]) -> Int32 {
if !resetActiveLow.value { // default is ignored inputs are held high
print("・Ensure that ignored inputs in the simulation are held low. Pass --holdLow if reset is active high.")
}
return EX_DATAERR
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Fault/Entries/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ func main(arguments: [String]) -> Int32 {

let startTime = CFAbsoluteTimeGetCurrent()

var models = [cells] + Array(includeFiles)
let models = [cells] + Array(includeFiles)

print("Performing simulations…")
let result = try Simulator.simulate(
Expand Down
9 changes: 8 additions & 1 deletion Sources/Fault/Module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,19 @@ struct Port: Codable {
var to = 0
var name: String!
if Bool(Python.hasattr(portDeclaration, "first"))! {
let type = "\(Python.type(portDeclaration[dynamicMember: "first"]).__name__)"
let declaration = portDeclaration[dynamicMember: "first"]
let type = "\(Python.type(declaration).__name__)"
if type == "Input" {
polarity = .input
} else {
polarity = .output
}
if declaration.width != Python.None {
let msb = Port.evaluate(expr: declaration.width.msb, params: paramaters)
let lsb = Port.evaluate(expr: declaration.width.lsb, params: paramaters)
from = msb
to = lsb
}
let firstChild = portDeclaration[dynamicMember: "first"]
name = "\(firstChild.name)"
} else {
Expand Down

0 comments on commit 1d4af0b

Please sign in to comment.