M
manu
Guest
Hi,
I'm using VHDL/SystemC cosimulation under Modelsim for validation of my
design.
All my synthesisable modules are written in VHDL and all my test benches
are written in SystemC since it offers very convenient features to build
complex test scenarios.
Until Now, it was OK since all my VHDL modules had "trivial" data types
on their ports (eg. std_logic and std_logic_vector). So the generation
of SystemC wrappers for my HDL modules was very easy thank to
"scgenmod" command.
Now, I want to use a custom data type like the following one :
package mytypes is
type my_custom_type_t is record
my_flag : std_logic;
my_bus : std_logic_vector(WIDTH-1 downto 0);
more_stuff : std_logic_whatever(YOU_HAPPEN to NEED);
...
end record;
end package;
and for my entity :
entity mydesign_top is
port
(
custom_input : in my_custom_type_t;
...All my other stuff...
);
end mydesign_top;
The problem is I don't know any "smart" way to bind a SytemC type to my
custom VHDL type. The only workaround I found for the moment is to
encapsulate my VHDL module into a VHDL wrapper in which I perform a
breakout of my custom type :
entity mydesign_top_wrap is
port
(
--begin custom_input breakout
custom_input_flag : std_logic;
custom_input_bus : std_logic_vector(WIDTH-1 downto 0);
custom_input_more_stuff : std_logic_whatever(YOU_HAPPEN to NEED);
...
--end custom_input breakout
...All my other stuff...
);
end mydesign_top_wrap;
But I don't like this solution because it is very hard to maintain my
whole source code when I modify the definition of my_custom_type_t.
Idealy, I would like to have only two file to modify : the VHDL package
and a corresponding C++ header in which would be defined the type mapping.
Does anyone know how to do this or any clean workaround ?
thanks for your help !
Manu
I'm using VHDL/SystemC cosimulation under Modelsim for validation of my
design.
All my synthesisable modules are written in VHDL and all my test benches
are written in SystemC since it offers very convenient features to build
complex test scenarios.
Until Now, it was OK since all my VHDL modules had "trivial" data types
on their ports (eg. std_logic and std_logic_vector). So the generation
of SystemC wrappers for my HDL modules was very easy thank to
"scgenmod" command.
Now, I want to use a custom data type like the following one :
package mytypes is
type my_custom_type_t is record
my_flag : std_logic;
my_bus : std_logic_vector(WIDTH-1 downto 0);
more_stuff : std_logic_whatever(YOU_HAPPEN to NEED);
...
end record;
end package;
and for my entity :
entity mydesign_top is
port
(
custom_input : in my_custom_type_t;
...All my other stuff...
);
end mydesign_top;
The problem is I don't know any "smart" way to bind a SytemC type to my
custom VHDL type. The only workaround I found for the moment is to
encapsulate my VHDL module into a VHDL wrapper in which I perform a
breakout of my custom type :
entity mydesign_top_wrap is
port
(
--begin custom_input breakout
custom_input_flag : std_logic;
custom_input_bus : std_logic_vector(WIDTH-1 downto 0);
custom_input_more_stuff : std_logic_whatever(YOU_HAPPEN to NEED);
...
--end custom_input breakout
...All my other stuff...
);
end mydesign_top_wrap;
But I don't like this solution because it is very hard to maintain my
whole source code when I modify the definition of my_custom_type_t.
Idealy, I would like to have only two file to modify : the VHDL package
and a corresponding C++ header in which would be defined the type mapping.
Does anyone know how to do this or any clean workaround ?
thanks for your help !
Manu