Skip to content

Commit

Permalink
a fNToRecFN test for normal number
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahanxie353 committed Feb 19, 2024
1 parent 41d5396 commit 464c8b4
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 0 deletions.
15 changes: 15 additions & 0 deletions runt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,21 @@ fud exec -s calyx.exec './target/debug/calyx' \
grep '%Error' | sed 's/%Error: [^:]*:[^:]*:/%Error:/'
"""

[[tests]]
name = "correctness floating-point"
paths = ["tests/correctness/float-point/*.futil"]
cmd = """
fud exec --from calyx --to jq \
--through icarus-verilog \
--through dat \
-s verilog.data {}.data \
-s calyx.exec './target/debug/calyx' \
-s verilog.cycle_limit 500 \
{} -q
"""
expect_dir = "tests/correctness/float-point/"
timeout = 10

##### Examples #####

[[tests]]
Expand Down
8 changes: 8 additions & 0 deletions tests/correctness/float-point/fNToRecFN.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cycles": 1,
"memories": {
"mem": [
2214592528
]
}
}
26 changes: 26 additions & 0 deletions tests/correctness/float-point/fNToRecFN.futil
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import "primitives/core.futil";
import "primitives/memories/comb.futil";
import "primitives/float-point/fNToRecFN.futil";

component main(@go go: 1) -> (@done done: 1) {
cells {
@external mem = comb_mem_d1(33, 1, 1);

fNToRecFN0 = fNToRecFN(8, 24, 32, 33);
}

wires {
group standard_to_recoded {
fNToRecFN0.in_ = 32'b01000011100000000000000000010000;

mem.addr0 = 1'b0;
mem.write_data = fNToRecFN0.out;
mem.write_en = 1'd1;
standard_to_recoded[done] = mem.done;
}
}

control {
standard_to_recoded;
}
}
10 changes: 10 additions & 0 deletions tests/correctness/float-point/fNToRecFN.futil.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"mem": {
"data": [0],
"format": {
"numeric_type": "bitnum",
"is_signed": false,
"width": 32
}
}
}

0 comments on commit 464c8b4

Please sign in to comment.