Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to define parameters in SystemC?

Status
Not open for further replies.

richa.verma

Newbie level 6
Joined
Jun 5, 2012
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,348
How can parameters(generics in VHDL) be included in SystemC? Right now I am trying to convert a code written in VHDL to SystemC. The VHDL code has some generics(parameters). How can I convert them to SystemC code?
 

Hello Maulin

Consider an example of bus. The bus is such that its width can be varied i,e., parametrized.

entity xyz is
GENERIC(
P_BUS_WIDTH : NATURAL : 8; --! default bus width is 8
);
PORT(
a : IN std_logic_vector(P_BUS_WIDTH downto 0);
b : OUT std_logic_vector(P_BUS_WIDTH downto 0);
);
architecture abc of xyz is
begin
..
b<= a;
..
end abc

In the above example vector length of both a and b can be varied by varying the the value of P_BUS_WIDTH.
I would like to know how can I use "GENERIC" variables(in this example it is P_BUS_WIDTH) of VHDL in systemc? I hope now my question is clear!

- - - Updated - - -

1 more question. How can "GENERATE" statements of VHDL be used in systemc?
 

Hello Maulin

Consider an example of bus. The bus is such that its width can be varied i,e., parametrized.

entity xyz is
GENERIC(
P_BUS_WIDTH : NATURAL : 8; --! default bus width is 8
);
PORT(
a : IN std_logic_vector(P_BUS_WIDTH downto 0);
b : OUT std_logic_vector(P_BUS_WIDTH downto 0);
);
architecture abc of xyz is
begin
..
b<= a;
..
end abc

In the above example vector length of both a and b can be varied by varying the the value of P_BUS_WIDTH.
I would like to know how can I use "GENERIC" variables(in this example it is P_BUS_WIDTH) of VHDL in systemc? I hope now my question is clear!

- - - Updated - - -

1 more question. How can "GENERATE" statements of VHDL be used in systemc?

I think U can define it like:
1) int P_BUS_WIDTH = 8; (SystemC is supported to C & CPP).

OR u can also do like
sc_int<4> a;
a = 8;
 
Last edited:

Thanks for your suggestion. What about "GENERATE" statements of VHDL?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top