mirror of https://github.com/zachjs/sv2v.git
fix errant reordering on cs/ps alias idents
This commit is contained in:
parent
24a79ffebe
commit
84986cc197
|
|
@ -656,12 +656,8 @@ traverseTypeIdentsM identMapper = fullMapper
|
|||
fullMapper = typeMapper
|
||||
>=> traverseTypeExprsM (traverseExprIdentsM identMapper)
|
||||
>=> traverseSinglyNestedTypesM fullMapper
|
||||
typeMapper (Alias x t) = aliasHelper (Alias ) x t
|
||||
typeMapper (PSAlias p x t) = aliasHelper (PSAlias p ) x t
|
||||
typeMapper (CSAlias c p x t) = aliasHelper (CSAlias c p) x t
|
||||
typeMapper (Alias x t) = identMapper x >>= return . flip Alias t
|
||||
typeMapper other = return other
|
||||
aliasHelper constructor x t =
|
||||
identMapper x >>= \x' -> return $ constructor x' t
|
||||
|
||||
-- visits all identifiers in an LHS
|
||||
traverseLHSIdentsM :: Monad m => MapperM m Identifier -> MapperM m LHS
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package P;
|
||||
typedef logic T;
|
||||
endpackage
|
||||
|
||||
package Q;
|
||||
typedef logic [7:0] U;
|
||||
endpackage
|
||||
|
||||
`define DUMP(x) initial $display(`"x: %0d %b`", $bits(x), x);
|
||||
|
||||
module top;
|
||||
P::T a;
|
||||
import Q::U;
|
||||
typedef U T;
|
||||
U b;
|
||||
T c;
|
||||
`DUMP(a)
|
||||
`DUMP(b)
|
||||
`DUMP(c)
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
`define DUMP(x) initial $display(`"x: %0d %b`", $bits(x), x);
|
||||
module top;
|
||||
wire a;
|
||||
wire [7:0] b, c;
|
||||
`DUMP(a)
|
||||
`DUMP(b)
|
||||
`DUMP(c)
|
||||
endmodule
|
||||
Loading…
Reference in New Issue