diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2018-12-31 19:13:25 +0100 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2018-12-31 19:13:25 +0100 |
commit | de580a7d4b5f4def9f0b71c6cff33ccad45d678b (patch) | |
tree | d7632f745db918da754b21ed951e30351a459f41 /src/Test/VeriFuzz/Graph/CodeGen.hs | |
parent | b679d2c6b19f647a3af98019426dfd05e8e103e9 (diff) | |
download | verismith-de580a7d4b5f4def9f0b71c6cff33ccad45d678b.tar.gz verismith-de580a7d4b5f4def9f0b71c6cff33ccad45d678b.zip |
Large refactor
Diffstat (limited to 'src/Test/VeriFuzz/Graph/CodeGen.hs')
-rw-r--r-- | src/Test/VeriFuzz/Graph/CodeGen.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Test/VeriFuzz/Graph/CodeGen.hs b/src/Test/VeriFuzz/Graph/CodeGen.hs index 64abb0a..eaa109e 100644 --- a/src/Test/VeriFuzz/Graph/CodeGen.hs +++ b/src/Test/VeriFuzz/Graph/CodeGen.hs @@ -35,8 +35,8 @@ statList g n = toStr <$> safe tail n lastEl :: [Node] -> Maybe Text lastEl n = fromNode <$> safe head n -toStatement :: (Graph gr) => gr Gate e -> LNode Gate -> Text -toStatement graph (n, g) = +toStmnt :: (Graph gr) => gr Gate e -> LNode Gate -> Text +toStmnt graph (n, g) = fromMaybe empty $ Just " assign " <> Just (fromNode n) <> Just " = " <> statList g nodeL <> lastEl nodeL <> Just ";\n" where @@ -48,7 +48,7 @@ generate graph = <> fromList (imap " input wire " ",\n" inp) <> sep ",\n" (imap " output wire " "" out) <> ");\n" - <> fromList (toStatement graph <$> labNodes graph) + <> fromList (toStmnt graph <$> labNodes graph) <> "endmodule\n\nmodule main;\n initial\n begin\n " <> "$display(\"Hello, world\");\n $finish;\n " <> "end\nendmodule" |