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.

"sel is not a constant" help required

Status
Not open for further replies.

Muddussir

Newbie level 4
Newbie level 4
Joined
Aug 12, 2016
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
31
Dear all
How can i remove the following error.
"sel is not a constant"
Code:
case (sel)
1'b0:
always @ ()
begin
-------------------
----------------
end
1'b1:
always @ ()
-----------------------
---------
end
endcase
 
Last edited by a moderator:

i want to select memory using case statement
 

Re: "sel is not a constant" help required

You can't schedule procedural blocks conditionally, e.g. inside a case construct.

What do you want to achieve?

- - - Updated - - -

I would expect the case construct inside an always @ block. Why multiple always @ for each selection?
 

Use a generate and if statements. I think that is what you are looking for to generate logic dependent on some constant or parameter.
 

The original error message suggests that the case construct isn't intended as generate replacement.

A memory enable can't be implemented by scheduling an always @ block conditionally. Instead you'll have conditional operations inside the always block.

Code:
always @(posedge clk)
begin
   if (sel==1'b0)
   begin
   end
end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top