Need advice for my vhdl code - vhdl

I am working on my college project a digital clock on altera board. the problem i am facing is my hours goes to 29 instead of 24! I am using integer type for my hours right digit ranging 0 to 9; i got if statement that when my hours left digit is 2 and hours right digit is 3 i want my second, minutes and hours 00:00:00.. But its not implementing why? Need some advice... Thanks
here is my code :
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
entity master is
port(
clk : in std_logic;
hrs_lft : out std_logic_vector(1 downto 0 );
hrs_rght : out std_logic_vector(3 downto 0 );
min_lft : out std_logic_vector(2 downto 0 );
min_rght : out std_logic_vector(3 downto 0 );
second_lft: out std_logic_vector(2 downto 0);
second_rght : out std_logic_vector( 3 downto 0)
);
end master;
architecture bhv of master is
signal second_lft_int : integer range 0 to 5;
signal second_rght_int : integer range 0 to 9;
signal min_lft_int : integer range 0 to 5;
signal min_rght_int : integer range 0 to 9;
signal hrs_lft_int : integer range 0 to 2;
signal hrs_rght_int : integer range 0 to 9;
begin
process(clk)
begin
if (rising_edge(clk)) then
second_rght_int <= second_rght_int + 1;
if second_rght_int = 9 then
second_lft_int <= second_lft_int + 1;
second_rght_int <= 0;
if second_lft_int = 5 then
second_lft_int <= 0;
min_rght_int <= min_rght_int + 1;
if min_rght_int = 9 then
min_lft_int <= min_lft_int + 1;
min_rght_int <= 0;
if min_rght_int = 5 then
hrs_rght_int <= hrs_rght_int + 1;
min_rght_int <= 0;
if hrs_rght_int = 9 then
hrs_lft_int <= hrs_lft_int + 1;
if (hrs_rght_int = 3 and hrs_lft_int = 2) then
hrs_lft_int <= 0;
hrs_rght_int <= 0;
min_lft_int <= 0;
min_rght_int <= 0;
second_rght_int <= 0;
second_lft_int <= 0;
end if ;
end if;
end if;
end if;
end if;
end if;
end if;
end process;
second_rght<= std_logic_vector(to_unsigned(second_rght_int,second_rght'length));
second_lft<=std_logic_vector(to_unsigned(second_lft_int,second_lft'length));
min_rght<= std_logic_vector(to_unsigned(min_rght_int,min_rght 'length));
min_lft <= std_logic_vector(to_unsigned(min_lft_int,min_lft'length));
hrs_rght<= std_logic_vector(to_unsigned(hrs_rght_int,hrs_rght 'length));
hrs_lft <= std_logic_vector(to_unsigned(hrs_lft_int,hrs_lft'length));
end bhv;

You process didn't look right, so I wrote it de novo:
process (clk)
begin
if rising_edge(clk) then
if second_rght_int = 9 then
second_rght_int <= 0;
if second_lft_int = 5 then
second_lft_int <= 0;
if min_rght_int = 9 then
min_rght_int <= 0;
if min_lft_int = 5 then
min_lft_int <= 0;
if (hrs_lft_int = 2 and hrs_rght_int = 4)
or hrs_rght_int = 9 then
hrs_rght_int <= 0;
if hrs_lft_int = 2 then
hrs_lft_int <= 0;
else
hrs_lft_int <= hrs_lft_int + 1;
end if;
else
hrs_rght_int <= hrs_rght_int + 1;
end if;
else
min_lft_int <= min_lft_int + 1;
end if;
else
min_rght_int <= min_rght_int + 1;
end if;
else
second_lft_int <= second_lft_int + 1;
end if;
else
second_rght_int <= second_rght_int + 1;
end if;
end if;
end process;
And that gives:
In VHDL "+" for integer is defined as an operation on a type integer and not a modular integer, you have to check for the boundary condition yourself.
You might also notice I set the clk rate to 1 ps in simulation. A bit excessive but I wanted to search for roll over events.
A testbench can consist of as little as a direct entity instantiation with a single port association for the clk. (The waveforms are from the Device Under Test).

Related

see analog output in xilinx instead of digital output

I am using code from this website code:
entity triangular is
port (clk : in std_logic;
wave_out : out std_logic_vector(7 downto 0);
reset :in std_logic
);
end triangular;
architecture Behavioral of triangular is
signal count,count2 : integer := 0;
signal direction : std_logic := '0';
begin
process(clk,reset)
begin
if(reset = '1') then
count <= 0;
count2 <= 129;
elsif(rising_edge(clk)) then
--"direction" signal determines the direction of counting - up or down
if(count = 253) then
count <= 0;
if(direction = '0') then
direction <= '1';
count2 <= 126;
else
direction <= '0';
count2 <= 129;
end if;
else
count <= count + 1;
end if;
if(direction = '0') then
if(count2 = 255) then
count2 <= 0;
else
count2 <= count2 + 1; --up counts from 129 to 255 and then 0 to 127
end if;
else
if(count2 = 255) then
count2 <= 0;
else
count2 <= count2 - 1; --down counts from 126 to 0 and then 255 to 128
end if;
end if;
end if;
end process;
wave_out <= conv_std_logic_vector(count2,8);
end Behavioral;
and I am getting output in digital format but I want to get output as given in the website link. How can I do that? I am new to VHDL working this as assignment.
(click to enlarge)
In Xilinx ISE simulator simulation result only in digital value instead of ISim you can use ModelSim simulator
In that ModelSim simulator Analog Data option Available
In Vivado Simulator Also have analog data view option

Signal parameter in a subprogram is not supported error

My code is about a ping pang game using VHDL and maxplus2. I can't get it complied.
library ieee;
use ieee.std_logic_1164.all;
-- use ieee.std_logic_unsigned.all;
-- use ieee.std_logic_arith.all;
entity center is
port (
clk: in std_logic;
ca: in std_logic;
cb: in std_logic;
enable: in std_logic;
a: in std_logic;
b: in std_logic;
ball: out std_logic_vector(16 downto 0);
sa: out std_ulogic;
sb: out std_ulogic;
over: inout std_ulogic
);
end center;
architecture behavior of center is
signal direction : integer range 0 to 2;
signal num : integer range -1 to 17;
begin
process (enable,ca,cb,a,b,clk)
begin
if enable = '0' then
over <= '0';
sa <= '0';
sb <= '0';
elsif enable = '1' and rising_edge(clk) then
if direction = 2 then
if ca = '1' then
direction <= 0;
num <= 1;
elsif cb = '1' then
direction <= 1;
num <= 16;
else
direction <= 2;
num <= 8;
end if;
elsif direction = 0 and num > 0 then
if b = '1' then
if num < 2 then
num <= num - 1;
direction <= 1;
else
direction <= 2;
sa <= '1' after 10 ns;
sb <= '0' after 10 ns;
over <= not over after 10 ns;
end if;
end if;
elsif direction = 1 and num <= 16 then
if a = '1' then
if num >= 14 then
num <= num + 1;
direction <= 2;
else
direction <= 2;
sa <= '0' after 10 ns;
sb <= '1' after 10 ns;
over <= not over after 10 ns;
end if;
end if;
elsif direction = 0 and num = -1 then
num <= 8;
direction <= 2;
sa <= '0' after 10 ns;
sb <= '1' after 10 ns;
over <= not over after 10 ns;
elsif direction = 0 and num = -1 then
num <= 8;
direction <= 2;
sa <= '0' after 10 ns;
sb <= '1' after 10 ns;
over <= not over after 10 ns;
end if;
end if;
end process;
end architecture behavior;
But I get a error:
signal parameter in a subprogram is not supported
I am confused, I don't know why I get this error.
I think as David also said you need to provide more information.
What it looks like for me is that your are writing a test bench the above code cannot be synthesized correctly. ISE will tell you that your syntax is ok but the delays are ignored IE the after keyword. The after keyword is only used in simulation.
That said i would also clean up the code there are a lot of redundancies. FX
The last two elsif statements. only one is needed. and the sensitivity list. only clk and enable should be there.
I've tried to clean up your code:
process (enable,clk)
begin
if enable = '0' then
over <= '0';
sa <= '0';
sb <= '0';
elsif rising_edge(clk) then
case( direction ) is
when 0 =>
if num > 0 then
if b = '1' then
if num < 2 then
num <= num - 1;
direction <= 1;
else
direction <= 2;
sa <= '1' after 10 ns;
sb <= '0' after 10 ns;
over <= not over after 10 ns;
end if;
end if;
elsif num = -1 then
num <= 8;
direction <= 2;
sa <= '0' after 10 ns;
sb <= '1' after 10 ns;
over <= not over after 10 ns;
end if;
when 1 =>
if num <= 16 then
if a = '1' then
if num >= 14 then
num <= num + 1;
direction <= 2;
else
direction <= 2;
sa <= '0' after 10 ns;
sb <= '1' after 10 ns;
over <= not over after 10 ns;
end if;
end if;
end if;
when 2 =>
if ca = '1' then
direction <= 0;
num <= 1;
elsif cb = '1' then
direction <= 1;
num <= 16;
else
direction <= 2;
num <= 8;
end if;
when others => NULL;
end case ;
end if;
end process;
Try and remove your after keywords and see if it will compile then.

vhdl manual clock hour set

I am trying to make an alarm clock for a final project in one of my classes. I am using push buttons on a DE1 Altera board to manually increment hours and mins. The mins work but I can not get the hours to increment manually. All pin assignments are correct.
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity ClkMain is port (
clk,pb_hr,pb_min,clk_set,almr_enbl: in std_logic;
almr_hr: in integer range 0 to 23;
almr_min: in integer range 0 to 59;
clk_min : out integer range 0 to 59;
clk_hr : out integer range 0 to 23;
almr_indct : out bit
);
end ClkMain;
architecture Behavioral of ClkMain is
signal sec, min: integer range 0 to 60 :=0;
signal hr: integer range 0 to 24 := 0;
begin
clk_min <= min;
clk_hr <= hr;
process(clk) --normal clock operation
begin
if(clk'event and clk='1') then
sec <= sec + 1;
if(sec + 1 = 60 or (pb_min = '1' and clk_set = '1') ) then
sec <= 0;
min <= min + 1;
if (min + 1 = almr_min and hr = almr_hr and almr_enbl = '1') then
almr_indct <= '1';
else
almr_indct <= '0';
end if;
if(min + 1 = 60 ) then
hr <= hr + 1;
min <= 0;
if(hr + 1 = 24) then
hr <= 0;
if (clk'event and clk='1' and pb_hr = '1' and clk_set = '1')then
hr <= hr + 1;
end if;
end if;
end if;
end if;
end if;
end process;
end Behavioral;
You can see where the error is by indenting properly:
library ieee;
use ieee.std_logic_1164.all;
-- use ieee.std_logic_arith.all;
-- use ieee.std_logic_unsigned.all;
entity ClkMain is
port (
clk,pb_hr,pb_min,clk_set,almr_enbl: in std_logic;
almr_hr: in integer range 0 to 23;
almr_min: in integer range 0 to 59;
clk_min: out integer range 0 to 59;
clk_hr: out integer range 0 to 23;
almr_indct : out bit
);
end ClkMain;
architecture Behavioral of ClkMain is
signal sec, min: integer range 0 to 60 :=0;
signal hr: integer range 0 to 24 := 0;
begin
clk_min <= min;
clk_hr <= hr;
process(clk) --normal clock operation
begin
if clk'event and clk = '1' then
sec <= sec + 1;
if sec + 1 = 60 or (pb_min = '1' and clk_set = '1') then
sec <= 0;
min <= min + 1;
if min + 1 = almr_min and hr = almr_hr and almr_enbl = '1' then
almr_indct <= '1';
else
almr_indct <= '0';
end if;
if min + 1 = 60 then
hr <= hr + 1;
min <= 0;
if hr + 1 = 24 then
hr <= 0;
if clk'event and clk = '1' and pb_hr = '1' and clk_set = '1' then
hr <= hr + 1;
end if;
end if;
end if;
end if;
end if;
end process;
end Behavioral;
The clk condition is enclosed in the outermost if statement and isn't necessary:
if clk'event and clk = '1' and pb_hr = '1' and clk_set = '1' then
Should be
if pb_hr = '1' and clk_set = '1' then
And that brings us to what's wrong. pb_hr is only evaluated at 11 PM:
if hr + 1 = 24 then
hr <= 0;
if pb_hr = '1' and clk_set = '1' then
hr <= hr + 1;
end if;
end if;
At a minimum these two if statements need to be at the same nesting level.
Unfortunately it also makes you take a look up the if statement nesting levels where you notice you can only set hours at 23:59:59, or you're also holding down pb_min and clk_set is true.
Also notice you almr_indct is true for a minute no matter what you do. I'd suggest moving the sets and alarm detection outside the enclosing if statement with the clock condition (keep them in the same process). It should also be invalidated when clk_set is true.
Looking even further back:
if sec + 1 = 60 or (pb_min = '1' and clk_set = '1') then
sec <= 0;
min <= min + 1;
We see you could reach 60 for a button push. That all needs to be fixed. It's also possible to move the alarm comparison outside of the counters and disable during clock set.
So you could manipulate the process statement:
architecture foo of clkmain is
signal sec, min: integer range 0 to 59 := 0;
signal hr: integer range 0 to 23 := 0;
signal sec_neq_59: std_logic;
signal min_neq_59: std_logic;
signal hr_neq_23: std_logic;
begin
clk_min <= min;
clk_hr <= hr;
sec_neq_59 <= '0' when sec = 59 else '1';
min_neq_59 <= '0' when min = 59 else '1';
hr_neq_23 <= '0' when hr = 23 else '1';
CLOCK_PROCESS:
process(clk)
begin
if clk'event and clk = '1' then
ALARM_INDICATON:
if min = almr_min and hr = almr_hr and almr_enbl = '1' then
almr_indct <= to_bit(not clk_set);
else
almr_indct <= '0';
end if;
SET_MINUTES:
if pb_min = '1' and clk_set = '1' then
if min_neq_59 = '1' then
min <= min + 1;
else
min <= 0;
end if;
SET_HOURS:
elsif pb_hr = '1' and clk_set = '1' then
if hr_neq_23 = '1' then
hr <= hr + 1;
else
hr <= 0;
end if;
INCREMENT_SECONDS:
elsif sec_neq_59 = '1' then
sec <= sec + 1;
else -- sec = 59
sec <= 0;
INCREMENT_MINUTES:
if min_neq_59 = '1' then
min <= min + 1;
else -- :59:59
min <= 0;
INCREMENT_HOURS:
if hr_neq_23 = '1' then
hr <= hr + 1;
else -- 23:59:59
hr <= 0;
end if;
end if;
end if;
end if;
end process;
end architecture foo;
And with the opportunity I fixed the range for the sec, min and hr counters. The secret is evaluating before incrementing, you intercept a terminal count with a synchronous load.
Also switched to equality comparisons to specific values, separated them to reduce hardware by having one set and prioritized the push buttons over the clock operation by using elsif.
So now push buttons can't cause range errors in minutes and hours, and are independent of actual clock time.
I don't think it's valid to reset seconds when incrementing minutes with the push button. It might be valid to keep seconds at 0 while clock_set is true, which would stop the clock from running when being set. That doesn't work if you're only fixing daylight savings time or changing time zones, though.
I haven't simulated this. It analyzes and elaborates. Range errors in assignment would show up during simulation.
I left almr_indct as type bit, but did use clk_set as a condition for the alarm indication.

VHDL Counter 0 to 99

i have a problem with my code it supposed to count from 0 to 99 but the problem that i have is that the counter starts at "80" and the Left number only increments at 10 seconds so it repeats..
Something like this
Starts at: 80 81 82 83 84 04 05 06 07 08 09
My code is this:
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned;
-- pin 86 selector de display 1
-- pin 87 selec2 display
-- Seg A pin 85, Seg B 84, Seg C 83, D 82, E 81, F 78, Seg g pin 77, H 76
entity ContadorExamen is
port(
CLK : in std_logic; -- se le asigna el pin 12
--clk1hz : out std_logic ;-- se le asigna el pin 51
datos : out std_logic_vector (6 downto 0);
unidades : out std_logic;
decenas: out std_logic
);
end entity;
architecture BH_Examen2Parcial of ContadorExamen is
signal freq1 : integer range 0 to 5000 := 0;
signal freqDec : integer range 0 to 24999999 := 0;
signal freq100 : integer range 0 to 249999999 := 0;
signal tmp1 : std_logic := '0';
signal tmp100 : std_logic := '0';
signal tmpDec : std_logic := '0';
signal counterUnidades : integer range 0 to 10 := 0;
signal counterDecenas : integer range 0 to 10 := 0;
signal segDecenas : std_logic_vector(6 downto 0);
signal segUnidades : std_logic_vector(6 downto 0);
begin
process(CLK) is
begin
if(CLK'event and CLK = '1') then
if(freq1 >= 5000) then
freq1 <= 0;
tmp1 <= not tmp1;
else
freq1 <= freq1 + 1;
tmp1 <= tmp1;
end if;
if(freq100 >= 249999999) then
freq100 <= 0;
tmp100 <= not tmp100;
else
freq100 <= freq100 + 1;
tmp100 <= tmp100;
end if;
if(freqDec >= 24999999) then
freqDec <= 0;
tmpDec <= not tmpDec;
else
freqDec <= freqDec + 1;
tmpDec <= tmpDec;
end if;
end if;
end process;
-- principio de cambios en el programa
process(tmp1) is
begin
if(tmp1 = '1') then
unidades <= '0';
decenas <= '1';
datos <= segDecenas;
else
datos <= SegUnidades;
decenas <= '0';
unidades <= '1';
end if;
end process;
ParaContarUnidades:process(tmp100) is
begin
if (tmp100 = '1') then
if(counterUnidades = 0) then
segUnidades <= "0000001";
elsif (counterUnidades = 1 ) then
segUnidades <= "1001111";
elsif (counterUnidades = 2 ) then
segUnidades <= "0010010";
elsif (counterUnidades = 3 ) then
segUnidades <= "0000110";
elsif (counterUnidades = 4 ) then
segUnidades <= "1001100";
elsif (counterUnidades = 5 ) then
segUnidades <= "0100100";
elsif (counterUnidades = 6 ) then
segUnidades <= "1100000";
elsif (counterUnidades = 7 ) then
segUnidades <= "0001111";
elsif (counterUnidades = 8 ) then
segUnidades <= "0000000";
elsif (counterUnidades = 9) then
segUnidades <= "0001100";
else
segUnidades <= "1111111";
end if;
if(counterUnidades < 9) then
counterUnidades <= counterUnidades + 1;
else
counterUnidades <= 0;
end if;
end if;
end process;
ParaContarDecenas:process(tmpDec) is
begin
if (tmpDec = '1') then
if(counterDecenas = 0) then
segDecenas <= "0000001";
elsif (counterDecenas = 1 ) then
segDecenas <= "1001111";
elsif (counterDecenas = 2 ) then
segDecenas <= "0010010";
elsif (counterDecenas = 3 ) then
segDecenas <= "0000110";
elsif (counterDecenas = 4 ) then
segDecenas <= "1001100";
elsif (counterDecenas = 5 ) then
segDecenas <= "0100100";
elsif (counterDecenas = 6 ) then
segDecenas <= "1100000";
elsif (counterDecenas = 7 ) then
segDecenas <= "0001111";
elsif (counterDecenas = 8 ) then
segDecenas <= "0000000";
elsif (counterDecenas = 9) then
segDecenas <= "0001100";
else
segDecenas <= "1111111";
end if;
if(counterDecenas < 9) then
counterDecenas <= counterDecenas + 1;
else
counterDecenas <= 0;
end if;
end if;
end process;
end architecture;
A couple issues that you will want to look into:
Note that counterDecenas and counterUnidades should be in the sensitivity list of the processes that use them because (as written) you want your segUnidades and segDecenas signals to update when tmpDec or tmp100 remain '1' but the counters change.
Moreover, you assign the counters to values based on themselves (such as counterDecenas <= counterDecenas + 1;) outside of a clocked process - this will produce a combinatorial loop. These need to be triggered only on clock edges.
Beyond that, it isn't clear what this entity is supposed to do. You say it is supposed to count from 0 to 99, but this clearly does more than the 1-liner that it would take to implement what you've described the desired functionality to be.

Infinite HDL synthesis

Whenver I try to synthesize my code, it is caught in an infinite loop i.e it is stuck at HDL SYNTHESIS. I have not used any loops. But problem persists.
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.NUMERIC_STD.ALL;
entity mat is
port(
start,clck,start4,add4,check4,delete3,start3,add3,final3,load,load3,load4,search3:in std_logic;
data1,data2,newitem:in std_logic_vector(0 to 8);
completeload4tocontroller,completeadd3,search3cmplt,completeload3tocontroller,
completeloadtocontroller,discerncomplete,complete4add,completedel3,step4comptocntrl:out bit;
data4,data6:out std_logic_vector(0 to 15));
end mat;
architecture Behavioral of mat is
type positiveelem is array (0 to 255) of std_logic_vector(0 to 18);
type negativeelem is array (0 to 255) of std_logic_vector(0 to 18);
signal poselem:positiveelem ;
signal negelem:negativeelem ;
signal pospointer:integer range 0 to 255:=0;
signal negpointer:integer range 0 to 255:=0;
signal jpst:integer range 0 to 255 := 0;
signal jnst:integer range 0 to 255 := 0;
signal jp1st:integer range 0 to 255 := 0;
signal jp2st:integer range 0 to 255 := 0;
signal jn4st:integer range 0 to 255 := 0;
signal jp4st:integer range 0 to 255 := 0;
signal j3pntr:integer range 0 to 255 := 0;
signal j3npntr:integer range 0 to 255 := 0;
signal j3ptr:integer range 0 to 255 := 0;
type list12 is array(0 to 65535) of integer range 0 to 31;
signal clist:list12;
signal limitcount:integer range 0 to 255 :=0;
signal flag1:std_logic :='0';
signal position:integer range 0 to 255;
begin
P1:process(load,load4,clck,load3,check4,start,add4,start4,start3,delete3,add3)
variable temp4:std_logic_vector(0 to 15);
variable temp5:std_logic_vector(0 to 15);
variable temp1:std_logic_vector(0 to 15);
variable tempp3:std_logic_vector(0 to 15);
begin
if(rising_edge(clck))then
if(load='1')then
poselem(pospointer) <= data1;
negelem(negpointer) <= data2;
pospointer <= pospointer + 1;
negpointer <= negpointer + 1;
limitcount <= limitcount + 1;
if(limitcount = 10)then
completeloadtocontroller <= '1';
end if;
elsif((load4 = '1') and (load ='0'))then
poselem(pospointer) <= newitem;
pospointer <= pospointer + 1;
completeload4tocontroller <= '1';
elsif((load3 = '1') and (load = '0'))then
negelem(negpointer) <= newitem;
negpointer <= negpointer + 1;
completeload3tocontroller <= '1';
elsif(start = '1')then
if((jpst <= pospointer) and (jnst <= negpointer))then
temp4 := poselem(jpst)(0 to 15) xor negelem(jnst)(0 to 15);
clist(conv_integer(temp4)) <= clist(conv_integer(temp4)) + 1;
if((jnst = (negpointer - 1)) and (jpst < (pospointer - 1)))then
jnst <= 0;
jpst <= jpst + 1;
elsif(jnst < (negpointer - 1) and (jpst < (pospointer - 1)))then
jnst <= jnst + 1;
elsif(jpst = (pospointer - 1) and (jnst < (negpointer - 1)))then
jnst <= jnst + 1;
elsif((jp1st = pospointer) and (jp2st = pospointer) and
(jpst = pospointer) and (jnst = negpointer))then
discerncomplete <= '1';
end if;
end if;
elsif(start4 = '1')then
if(add4 = '1')then
temp1 := newitem(0 to 15) xor negelem(jn4st)(0 to 15);
if(clist(conv_integer(temp1)) = 0)then
data4 <= temp1;
end if;
clist(conv_integer(temp1)) <= clist(conv_integer(temp1)) + 1;
if(jn4st < (negpointer - 1))then
jn4st <= jn4st + 1;
elsif((jp4st = pospointer - 1) and (jn4st = negpointer - 1))then
complete4add <= '1';
end if;
end if;
elsif(start3 = '1')then
if(delete3 = '1')then
if((poselem(position)(0 to 15) /= poselem(j3pntr))
and (poselem(position)(16 to 18) /= poselem(j3pntr)(16 to 18)))then
tempp3 := poselem(position)(0 to 15) xor poselem(j3pntr)(0 to 15);
if(clist(conv_integer(tempp3)) = 1)then
data6 <= tempp3;
end if;
if(clist(conv_integer(tempp3)) /= 0)then
clist(conv_integer(tempp3)) <= clist(conv_integer(tempp3)) - 1;
end if;
if(j3pntr < (pospointer - 1))then
j3pntr <= j3pntr + 1;
elsif((j3pntr = pospointer - 1) and (j3npntr = negpointer - 1))then
completedel3 <= '1';
poselem(position) <= "0000000000000000000";
end if;
end if;
elsif(search3 = '1')then
if((poselem(position)(16 to 18) /= newitem(16 to 18))
and (poselem(position)(0 to 15) = newitem(0 to 15)))then
flag1 <= '1';
end if;
if((position < pospointer) and (flag1 = '0'))then
position <= position + 1;
elsif(flag1 = '1')then
search3cmplt <= '1';
end if;
elsif(add3 = '1')then
tempp3 := newitem(0 to 15) xor poselem(j3ptr)(0 to 15);
if(clist(conv_integer(tempp3)) = 0)then
data4 <= tempp3;
end if;
clist(conv_integer(tempp3)) <= clist(conv_integer(tempp3)) + 1;
if(j3ptr < pospointer - 1 and (j3ptr = (position - 1)))then
j3ptr <= j3ptr + 2;
elsif(j3ptr = (pospointer - 1))then
completeadd3 <= '1';
else
j3ptr <= j3ptr + 1;
end if;
end if;
end if;
end if;
if(falling_edge(clck))then
if(start = '1')then
if((jp1st /= pospointer) and (jp2st /= pospointer) and (poselem(jp1st)(16 to 18) /= poselem(jp2st)(16 to 18))
and (poselem(jp1st)(0 to 15) /= poselem(jp2st)(0 to 15))) then
temp5 := poselem(jp1st)(0 to 15) xor poselem(jp2st)(0 to 15);
clist(conv_integer(temp5)) <= clist(conv_integer(temp5)) + 1;
end if;
if(jp1st < (pospointer - 1) and jp2st = (pospointer-1))then
jp1st <= jp1st + 1;
jp2st <= 0;
elsif(jp1st = (pospointer - 1) and jp2st < (pospointer-1))then
jp2st <= jp2st + 1;
elsif(jp1st < (pospointer - 1) and jp2st < (pospointer-1))then
jp2st <= jp2st + 1;
elsif((jp1st = pospointer) and (jp2st = pospointer) and (jpst = pospointer) and (jnst = negpointer))then
discerncomplete <= '1';
end if;
elsif(start4 = '1')then
if(add4 = '1')then
if((poselem(jp4st)(0 to 15) /= "0000000000000000"))then
if(poselem(jp4st)(0 to 15) /= newitem(0 to 15))
and (poselem(jp4st)(16 to 18) /= newitem(16 to 18)))then
temp1 := newitem(0 to 15) xor poselem(jp4st)(0 to 15);
if(clist(conv_integer(temp1)) = 0)then
data4 <= temp1;
end if;
clist(conv_integer(temp1)) <= clist(conv_integer(temp1)) + 1;
end if;
if(jp4st < (pospointer - 1))then
jp4st <= jp4st + 1;
elsif((jp4st = pospointer - 1) and (jn4st = negpointer - 1))then
complete4add <= '1';
end if;
end if;
elsif(start3 = '1')then
if(delete3 = '1')then
tempp3 := newitem(0 to 15) xor negelem(j3npntr)(0 to 15);
if(clist(conv_integer(tempp3)) = 1)then
data6 <= tempp3;
end if;
if(clist(conv_integer(tempp3)) = 0)then
clist(conv_integer(tempp3)) <= clist(conv_integer(tempp3)) - 1;
end if;
if(j3npntr < negpointer - 1 )then
j3npntr <= j3npntr + 1;
elsif((j3pntr = pospointer - 1) and (j3npntr = negpointer - 1))then
completedel3 <= '1';
poselem(position) <= "0000000000000000000";
end if;
end if;
end if;
end if;
end process P1;
end Behavioral;
My comments address some of these issues, but I thought I'd type them up as an answer to add a little more detail and clarification.
Synthesis software getting stuck at a certain step and locking up has little to nothing to do with any particular language structure you're using, and probably means the software is having trouble parsing your code. While I would call this a bug in the software, you can probably get around it by looking for syntax errors (using another compiler, like ModelSim or something, might also help, if you have access). For instance, you appear to have an if-loop you're not closing somewhere under if falling_edge(clck). You also have a missing ( on the lines:
if(poselem(jp4st)(0 to 15) /= newitem(0 to 15))
and (poselem(jp4st)(16 to 18) /= newitem(16 to 18)))then
And you're assigning data1, a 9-bit vector, to poselem(pospointer), a 19-bit vector (and other similar assignments). Check your port and signal definitions.

Resources