M
Mark Curry
Guest
All,
I've got a SystemVerilog question related to interfaces.
In my design I've got an array of interfaces:
interface foo_if();
// blah blah
modport master( /* blah */ );
modport slave( /* blah */ );
endinterface
foo_if foo_if_[ 3 : 0 ]();
I need to slice off ONE of the indices to go
to a subblock:
All's good:
foo_inst foo_inst ( .foo_if_( foo_if_[ 2 ] ) );
However, for reasons unsaid, I need to do this "assignment"
(for another index) again at this level to a new single interface:
foo_if foo_single_if_();
assign foo_single_if_ = foo_if_[ 1 ];
I can't find in the 2009 standard whether this is legal or not.
Two tools that I've used don't like it. I've tried
continous assignment ( which is what I see as happening "under the hood"
during an instancation), and a procedural assignment. Neither
works. Do I have to create a dummy module to just pick
instance array slices?
The tool needs to be smart in handling direction. But it does
that "magic" during the instanciation, and get's it right.
I'm thinking something with the modports, but I can't figure
it out. I DON'T want to resort to breaking the interface down
and assigning individual members - that ruins the whole point
of interfaces.
Thanks,
Mark
I've got a SystemVerilog question related to interfaces.
In my design I've got an array of interfaces:
interface foo_if();
// blah blah
modport master( /* blah */ );
modport slave( /* blah */ );
endinterface
foo_if foo_if_[ 3 : 0 ]();
I need to slice off ONE of the indices to go
to a subblock:
All's good:
foo_inst foo_inst ( .foo_if_( foo_if_[ 2 ] ) );
However, for reasons unsaid, I need to do this "assignment"
(for another index) again at this level to a new single interface:
foo_if foo_single_if_();
assign foo_single_if_ = foo_if_[ 1 ];
I can't find in the 2009 standard whether this is legal or not.
Two tools that I've used don't like it. I've tried
continous assignment ( which is what I see as happening "under the hood"
during an instancation), and a procedural assignment. Neither
works. Do I have to create a dummy module to just pick
instance array slices?
The tool needs to be smart in handling direction. But it does
that "magic" during the instanciation, and get's it right.
I'm thinking something with the modports, but I can't figure
it out. I DON'T want to resort to breaking the interface down
and assigning individual members - that ruins the whole point
of interfaces.
Thanks,
Mark