Skip to content

Commit

Permalink
Co-authored-by: Mohamed Gaber <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
kanndil committed Sep 29, 2024
1 parent 6b911cc commit de4a0c2
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ parsetab.py

.swiftpm/
abc.history
temp.txt
3 changes: 2 additions & 1 deletion Benchmarks/Benchmarks/aes128.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
* limitations under the License.
*/

module aes128(clk, state, key, out);
module aes128(clk, state, key, out, reset);
input clk;
input reset;
input [127:0] state, key;
output [127:0] out;
reg [127:0] s0, k0;
Expand Down
4 changes: 2 additions & 2 deletions Benchmarks/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function usage() {
echo " --all Runs Fault's complete flow"
echo " --synth Runs synthesis script"
echo " --cut Runs cut option on the synthesized netlist"
echo " -g, --tvgen Runs fault simulation using the specified TV generator (swift, atalanta, LFSR, PODEM)"
echo " -g, --tvgen Runs fault simulation using the specified TV generator (swift, atalanta, LFSR, PODEM, PodemQuest)"
echo " --delay Runs the transition fault simulator"
echo " --chain Runs chain option on the synthesized netlist"
echo " --tap Runs tap option on the chained netlist"
Expand Down Expand Up @@ -194,7 +194,7 @@ do
ignoring="-i $ignored_input,$clock_signal,$reset_signal"
fi
# Check tvgen type
if [ $tvgen = "atalanta" ] || [ $tvgen = "podem" ];
if [ $tvgen = "atalanta" ] || [ $tvgen = "podem" ] || [ $tvgen = "PodemQuest" ];
then
bench=$cut_netlist.bench
echo "Generating bench circuit for $cut_netlist"
Expand Down
2 changes: 2 additions & 0 deletions Sources/Fault/Entries/atpg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ extension Fault {
evtInputsMinusIgnored.append(input)
}
}
print(inputsMinusIgnored);
print(evtInputsMinusIgnored);
assert(inputsMinusIgnored.count == evtInputsMinusIgnored.count);
inputsMinusIgnored = evtInputsMinusIgnored
}
Expand Down
1 change: 1 addition & 0 deletions Sources/Fault/Entries/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ _ = [ // Register all TVGens
Atalanta.registered,
Quaigh.registered,
PODEM.registered,
PodemQuest.registered,
]

let yosysTest = "'\(yosysExecutable)' -V".sh(silent: true)
Expand Down
2 changes: 2 additions & 0 deletions Sources/Fault/Synthesis.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum Synthesis {
# check design hierarchy
hierarchy \(checkHierarchy ? "-check" : "") -top \(module)
flatten;
# translate processes (always blocks)
proc; \(opt)
Expand All @@ -60,6 +61,7 @@ enum Synthesis {
# mapping logic to mycells.lib
abc -liberty \(libertyFile)
splitnets -ports
# print gate count
stat
Expand Down
25 changes: 25 additions & 0 deletions Sources/Fault/TVGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,28 @@ class PODEM: ExternalTestVectorGenerator {

static let registered = ETVGFactory.register(name: "PODEM", type: PODEM.self)
}


class PodemQuest: ExternalTestVectorGenerator {

required init() {}

func generate(file: String, module: String) -> ([TestVector], [Port]) {
let output = file.replacingExtension(".bench", with: ".test")
let podemQuest = "podemquest -i\(file) -o \(output)".sh()

if podemQuest != EX_OK {
exit(podemQuest)
}

do {
let (testvectors, inputs) = try TVSet.readFromTest(output, withInputsFrom: file)
return (vectors: testvectors, inputs: inputs)
} catch {
Stderr.print("Internal software error: \(error)")
exit(EX_SOFTWARE)
}
}

static let registered = ETVGFactory.register(name: "PodemQuest", type: PodemQuest.self)
}
1 change: 1 addition & 0 deletions docs/Source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ are some pointers nevertheless.
- [Quaigh](https://github.com/coloquinte/quaigh) (Optional but really recommended)
- [Atalanta](https://github.com/hsluoyz/atalanta) (Optional)
- [NTU EE PODEM](https://github.com/donn/VLSI-Testing) (Optional)
//todo: add PodemQuest
7 changes: 4 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
inputs = {
nix-eda.url = github:efabless/nix-eda;
nl2bench = {
url = github:donn/nl2bench;
url = github:donn/nl2bench/dirtiest_workaround_imaginable;
inputs.nix-eda.follows = "nix-eda";
};
quaigh = {
Expand All @@ -21,15 +21,14 @@

devShells = nix-eda.forAllSystems { withInputs = [nix-eda quaigh nl2bench self]; } (util: with util; rec {
mac-testing = pkgs.stdenvNoCC.mkDerivation (with pkgs; let
pyenv = (python3.withPackages(ps: with ps; [pyverilog pyyaml pytest]));
pyenv = (python3.withPackages(ps: with ps; [pyverilog pyyaml pytest pkgs.nl2bench]));
in {
# Use the host's Clang and Swift
name = "shell";
buildInputs = [
yosys
verilog
pkgs.quaigh
pkgs.nl2bench
pyenv
gtkwave
];
Expand Down

0 comments on commit de4a0c2

Please sign in to comment.