How to create an instance of an already existing component in verilog?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I'm writing a component using another component and was wondering what is the syntax to do that? I think I've read somewhere this is possible but I'm not entirely sure.

0 Likes
3 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Are you defining your new component as schematic? Then you should be able to just add the existing component to it.

0 Likes
Anonymous
Not applicable

No, the new component is in verilog, as stated above.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Silly me, stopped reading the subject too early 😞

   

AFAIK you can only instantiate components that are itself defined in verilog. So look whether the one you need is (there must be a meaningful .v file).

   

You need to include this .v file into yours (or cypress.v if its a PSoC building block such as clocks or control regs) and then just instantiate the component. I did a quick search in the existing components, and many of them instatiate registers and clock blocks - but I did not find one the re-uses another component. But looking at them should show how its done.

0 Likes