hi all,
can i use part of a bus as statement in case?
for an example:
case ( work_plan(2:0) )
00 :
and etc'
well it not wroking for me, so i meant, how should i write it ? should i declare a new reg ?
shmulik wrote: > hi all, > can i use part of a bus as statement in case? > > for an example: > case ( work_plan(2:0) ) > 00 : > > and etc' This should work. If there is something wrong, it is outside the sample.
i wrote :
always @ ( slsrc or sldet )
begin
case ( work_plan(2:0) )
APB_SLAVE1 :
sone_addr = sldst;
sone_we = 1111;
sone_wdata = prdata;
and this is the massge i recive when trying to compile:
...(165): near ":": syntax error, unexpected ':', expecting ')'.
when i deleted it, and wrote:
always @ ( slsrc or sldet )
begin
case ( work_plan )
APB_SLAVE1 :
sone_addr = sldst;
sone_we = 1111;
sone_wdata = prdata;
i recive no error.
Sorry i overlooked a fundamental error in your sample You need to use square brackets!
lol its working, how i didn't see that ?!?! thanks very much !!!!!!!
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
Log in with Google account
No account? Register here.