diff options
author | Yann Herklotz <git@yannherklotz.com> | 2020-05-09 16:40:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-09 16:40:44 +0100 |
commit | d50a0b5b57aae1c7558fa77c362ae2e36038b63c (patch) | |
tree | 9baedb7e8ef25c58b37ce78e65ceecb71972a43d /src/Verismith.hs | |
parent | 088b5d8694c31f8ac8276afc4fdcfd76ceb69843 (diff) | |
download | verismith-d50a0b5b57aae1c7558fa77c362ae2e36038b63c.tar.gz verismith-d50a0b5b57aae1c7558fa77c362ae2e36038b63c.zip |
Add distance function (#75)
* Add distance function
* Add distance measure for lists with testcases
* Add more distance measures for AST
* Add distance to commandline
* Fix distance always giving 0
Diffstat (limited to 'src/Verismith.hs')
-rw-r--r-- | src/Verismith.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Verismith.hs b/src/Verismith.hs index c9d3e78..9dc3475 100644 --- a/src/Verismith.hs +++ b/src/Verismith.hs @@ -70,6 +70,7 @@ import Verismith.Tool import Verismith.Tool.Internal import Verismith.Verilog import Verismith.Verilog.Parser (parseSourceInfoFile) +import Verismith.Verilog.Distance import Verismith.Utils (generateByteString) toFP :: String -> FilePath @@ -216,6 +217,11 @@ handleOpts (ConfigOpt c conf r) = do $ T.unpack . toTextIgnore <$> c +handleOpts (DistanceOpt v1 v2) = do + src1 <- parseSourceInfoFile (T.pack v1) (toTextIgnore v1) + src2 <- parseSourceInfoFile (T.pack v2) (toTextIgnore v2) + let d = distance src1 src2 + putStrLn ("Distance: " <> show d) defaultMain :: IO () defaultMain = do |