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.

syntax error near process

Status
Not open for further replies.

bob2987

Junior Member level 1
Junior Member level 1
Joined
Feb 20, 2014
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
192
Hi All !

I'm a student in VHDL design and I am trying to create an accumulator in VHDL. This is my code :


Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
 
entity AC is
    Port ( store : in STD_LOGIC;
           ld_AC : in STD_LOGIC;
           RAZ : in STD_LOGIC;
           clk : in STD_LOGIC;
           D : in STD_LOGIC_VECTOR (15 downto 0);
           Q : out STD_LOGIC_VECTOR (15 downto 0);
           Q_mem : out STD_LOGIC_VECTOR (15 downto 0));
end AC;
 
architecture Behavioral of AC is
signal temp: STD_LOGIC_VECTOR (15 downto 0);
 
begin
 
process (RAZ,clk)
 
begin
 
if RAZ = '0' then
Q <= (Q'range => '0');
 
elsif (clk='1' and clk'event) then
        if (ld_AC ='1') then
        temp <= D;
        else if (store='1') then
        Q <= temp;
        else Q <= "ZZZZZZZZZZZZZZZZ";
        end if;
end if;
 
end process;
 
end Behavioral;



I have an error "syntax error near process". Can anybody help me ? I think I forgot an "end if" but i'm note sure.

Thank you.

Bob
 
Last edited by a moderator:

you cannot use software syntaxes in your vhdl code.you need to use the vhdl syntaxes.

what software syntax are you referring to? The op just made a simple error as imbichi pointed out.

its much easier for the op if you actually help, rather than just make some vague comments
 

what software syntax are you referring to? The op just made a simple error as imbichi pointed out.

its much easier for the op if you actually help, rather than just make some vague comments

i am surprised that it is you who is telling such sweet things!!!...you never gave me any freebies when I was a fresher :D...i do not know if you do remember them...btw I dont consider it vague because "else if" is a basic error and the compiler would definitely show where the person what is wrong...i am just telling the op to go through the basic syntaxes and its the way to go about...else if are the commands you use in software based compilers....these are the errors which should be avoided...
 

Else if is used in verilog, and that is a hardware language.

The op made a simple typing error. Otherwise the code is good. Its hardly written like software.

- - - Updated - - -

On a design, rather than code point, you cannot tri state an output ( well you can, but there's no point.)
 

as far as i am concerned it looked like a vhdl code because verilog has a much different syntax as compared to vhdl and i believe i have read that its more flexible than vhdl like a software code but of course has its own drawbacks as compared to vhdl...

well there are more bad responses at xilinx user forums for a silly typing error...i am sure you are aware of it...
 

On a design, rather than code point, you cannot tri state an output ( well you can, but there's no point.)
Yes, you can tristate an output, creating a tristate driver, and it can well serve a purpose. Consider e.g. the data port of a bus connected ROM, or simply an open drain output.

Regarding the "else if" syntax error, it can be legal VHDL syntax, but needs another closing end if. You can see elsif just as a shortcut.

Code:
if condition_a then
--
else if condition_b then
--
  end if;
end if;
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top