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.

Who can tell me what difference of them? (VHDL)

Status
Not open for further replies.

75 sinfocia

Newbie level 2
Newbie level 2
Joined
May 19, 2002
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
27
signal rd,dr : std_logic;
ad_bus,ram_bus : inout;
:cry:
1.
process(rd) ---- right.
begin
if (rd='0' and dr='1') then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
ad_bus<=ad_bus_out;
end process;

2.
process(rd) ---- error.
begin
if (rd='0') then
if dr='1' then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
end if;
ad_bus<=ad_bus_out;
end process;

3.
process(rd,dr) ---- right.
begin
if (rd='0') then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
ad_bus<=ad_bus_out;
end process;

4.
process(rd) ---- error.
begin
if (rd='0') then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
ad_bus<=ad_bus_out;
end process;
 

cuiyujie

Junior Member level 3
Junior Member level 3
Joined
Apr 25, 2002
Messages
26
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
128
Hi,

It's not clear what's dr, ad_bus_out and what you really want to implement for those 2 signals. One thing you should keep in mind is to make the sensitivitly list complete in process if you want to use process.

Or else, Another way maybe just as simple as:
ad_bus <= ram_bus when rd = '0' else
"(others => 'Z');
 

wjhzhx

Junior Member level 1
Junior Member level 1
Joined
Mar 25, 2002
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
92
The process 2 is wrong because it will generate latch, when rd = 1, what is the result ?
But I can't understand where is wrong in process 4
 

VicL

Member level 1
Member level 1
Joined
May 20, 2002
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Old Great Europe
Activity points
150
75 sinfocia said:
signal rd,dr : std_logic;
ad_bus,ram_bus : inout;
:cry:
1.
process(rd) ---- right.
begin
if (rd='0' and dr='1') then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
ad_bus<=ad_bus_out;
end process;

2.
process(rd) ---- error.
begin
if (rd='0') then
if dr='1' then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
end if;
ad_bus<=ad_bus_out;
end process;

3.
process(rd,dr) ---- right.
begin
if (rd='0') then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
ad_bus<=ad_bus_out;
end process;

4.
process(rd) ---- error.
begin
if (rd='0') then
ad_bus_out<=ram_bus;
else
ad_bus_out<="ZZZZZZZZ";
end if;
ad_bus<=ad_bus_out;
end process;

May be you have conflict with other design part
when dr signal not used in examples 2 and 4?
 

linuxluo

Full Member level 6
Full Member level 6
Joined
Jul 26, 2002
Messages
331
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
2,514
Hi,
I think first thing is to complete your sensitive list of your process ,otherwise you can't simulate it correctly.
 

corgan

Member level 3
Member level 3
Joined
Jan 15, 2002
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
319
All of four blocks are sensitivity list incomplete. Vhdl is a strong type language, don't you get a error message about that when you compile the codes?
 

linuxluo

Full Member level 6
Full Member level 6
Joined
Jul 26, 2002
Messages
331
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
2,514
Hi,
2 is error because the designer want to latch "z" state . it's illegal.
 

linuxluo

Full Member level 6
Full Member level 6
Joined
Jul 26, 2002
Messages
331
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
2,514
Hi
4 is simulated in error because incomplete sensitive list but can be synthesis correctly and gate simulation correctly.
 

dennisplus

Newbie level 6
Newbie level 6
Joined
Nov 29, 2002
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
15
please read the VHDL book carefully, all the sensitive list should include in the process. or you will get a error result.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top