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.

Verilog Package File - compiler is throwing error

Status
Not open for further replies.

vlsi_freak

Full Member level 2
Joined
Sep 3, 2007
Messages
127
Helped
14
Reputation
28
Reaction score
8
Trophy points
1,298
Activity points
2,041
Verilog Package File

Hi All,

I have some lines of code in my project like,

Caseaddr[7:0]
8'b 00000000 : reg <= '1';
8'b 00000001 : reg <= '0';
-
-
8'b11111111 : reg <= '1'

Here i would like to replace address with some names like ,

Caseaddr[7:0]
Reg1 : reg <= '1';
Reg2 : reg <= '0';
-
-
Regn : reg <= '1'

I have made a file REG_PKG.v and defined like,

'define 8'b 00000000 Reg1

But still compiler is throwing error saying that, Reg1, Reg2 etc is not declared.
Here, i have compiled the Package file and added line `include in my original code.

Please help me, how to make a constants file in Verilog similar to VHDL.

regards,
freak
 

Re: Verilog Package File

Hi,
You've defined in wrong way. try below

'define Reg1 8'b00000000

this will work.

(Do not put any space in your defines)

-Paul
 

Re: Verilog Package File

Also put `(acute) before the name of define, when you use it.

e.g.

Caseaddr[7:0]
`Reg1 : reg <= '1';
`Reg2 : reg <= '0';
-
-
`Regn : reg <= '1'
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top