From 5db743f5343e874dfeab2e4f81ee98550ce8ef49 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 29 Dec 2018 01:56:39 +0100 Subject: Changes to the API --- src/Test/VeriFuzz/Verilog/Mutate.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Test/VeriFuzz/Verilog/Mutate.hs') diff --git a/src/Test/VeriFuzz/Verilog/Mutate.hs b/src/Test/VeriFuzz/Verilog/Mutate.hs index 66e56a1..6731b65 100644 --- a/src/Test/VeriFuzz/Verilog/Mutate.hs +++ b/src/Test/VeriFuzz/Verilog/Mutate.hs @@ -21,7 +21,11 @@ import Test.VeriFuzz.Verilog.AST -- | Return if the 'Identifier' is in a 'ModDecl'. inPort :: Identifier -> ModDecl -> Bool -inPort id mod = any (\a -> a ^. portName == id) $ mod ^. modPorts +inPort id mod = inInput || inOutput + where + inInput = any (\a -> a ^. portName == id) $ mod ^. modInPorts + inOutput = fromMaybe False . safe head $ (==id) <$> + mod ^.. modOutPort . _Just . portName -- | Find the last assignment of a specific wire/reg to an expression, and -- returns that expression. -- cgit