mirror of https://github.com/zachjs/sv2v.git
remove duplicate always_comb sensitivities
This commit is contained in:
parent
d30c7e7f4e
commit
380c2b978a
|
|
@ -1,3 +1,10 @@
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Other Enhancements
|
||||||
|
|
||||||
|
* `always_comb` blocks with sensitivities inherited from called functions or
|
||||||
|
tasks are no longer converted with duplicate expressions
|
||||||
|
|
||||||
## v0.0.13
|
## v0.0.13
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ module Convert.AlwaysKW (convert) where
|
||||||
import Control.Monad (when, zipWithM, (>=>))
|
import Control.Monad (when, zipWithM, (>=>))
|
||||||
import Control.Monad.State.Strict
|
import Control.Monad.State.Strict
|
||||||
import Control.Monad.Writer.Strict
|
import Control.Monad.Writer.Strict
|
||||||
|
import Data.List (nub)
|
||||||
import Data.Maybe (fromMaybe, mapMaybe)
|
import Data.Maybe (fromMaybe, mapMaybe)
|
||||||
import Data.Monoid (Any(Any), getAny)
|
import Data.Monoid (Any(Any), getAny)
|
||||||
|
|
||||||
|
|
@ -234,7 +235,7 @@ findNonLocals item = do
|
||||||
_ <- scoper item
|
_ <- scoper item
|
||||||
(anys, exprs) <- lift get
|
(anys, exprs) <- lift get
|
||||||
lift $ put prev
|
lift $ put prev
|
||||||
let nonLocals = mapMaybe (longestStaticPrefix scopes) exprs
|
let nonLocals = mapMaybe (longestStaticPrefix scopes) $ nub exprs
|
||||||
return (getAny anys, nonLocals)
|
return (getAny anys, nonLocals)
|
||||||
|
|
||||||
triggerIdent :: Identifier
|
triggerIdent :: Identifier
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
affirm always @(never or x1 or _sv2v_0)
|
||||||
|
affirm always @(never or x2 or _sv2v_0)
|
||||||
|
|
@ -3,7 +3,7 @@ reg never;
|
||||||
reg x``num, y``num, z``num; \
|
reg x``num, y``num, z``num; \
|
||||||
function automatic t``num; \
|
function automatic t``num; \
|
||||||
input inp; \
|
input inp; \
|
||||||
t``num = x``num; \
|
t``num = x``num + x``num; \
|
||||||
endfunction \
|
endfunction \
|
||||||
always``sense begin \
|
always``sense begin \
|
||||||
y``num = 0; \
|
y``num = 0; \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue