Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Counter simulation proper but giving trouble in DFT

Reply
Thread Tools

Counter simulation proper but giving trouble in DFT

 
 
nisheethg@gmail.com
Guest
Posts: n/a
 
      02-08-2007
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


entity su_pixel_counter is
Port ( CLK : in STD_LOGIC;
RESET : in STD_LOGIC;
EN : in STD_LOGIC;
CNTR_INCR : in STD_LOGIC;
LOAD_PIXEL : in STD_LOGIC;
TC : in STD_LOGIC_VECTOR( 3 downto 0);
COUNT_ONE : out STD_LOGIC;
COUNT_ONE_IF_INCR : out STD_LOGIC;-- First Count i.e. zero
CNTR : out STD_LOGIC_VECTOR ( 3 downto 0);
TC_MINUS_CNTR : out STD_LOGIC_VECTOR ( 3 downto 0);
SUM_OF_CNTR_AND_TC_MINUS_CNTR: out STD_LOGIC_VECTOR ( 3 downto 0);
PIXEL_CNTR_COUNT_OVER : out STD_LOGIC

--test
);
end su_pixel_counter;

architecture Behavioral of su_pixel_counter is

SIGNAL CNTR_IN : STD_LOGIC_VECTOR(3 downto 0); -- original value 1

--SIGNAL iCNTR : STD_LOGIC_VECTOR(3 downto 0);
--SIGNAL iTC_MINUS_CNTR : STD_LOGIC_VECTOR(3 downto 0);
--SIGNAL iSUM_OF_CNTR_AND_TC_MINUS_CNTR : STD_LOGIC_VECTOR(3 downto
0);

begin

process(CLK, RESET)
begin

if ( RESET ='1') then
CNTR_IN <= b"0000";
PIXEL_CNTR_COUNT_OVER <= '0';
COUNT_ONE_IF_INCR <= '0';


elsif(CLK'event and CLK ='1') then
if ( EN ='1') then
if (CNTR_INCR = '1') then

-- CNTR_IN <= CNTR_IN + 1;

if ( CNTR_IN = "0000") then
COUNT_ONE_IF_INCR<= '1';
PIXEL_CNTR_COUNT_OVER <= '0';
CNTR_IN <= CNTR_IN + 1;

elsif ( CNTR_IN = TC) then
COUNT_ONE_IF_INCR<= '0';
PIXEL_CNTR_COUNT_OVER <= '1';
CNTR_IN <= CNTR_IN + 1;

elsif ( CNTR_IN = TC + 1 ) then
COUNT_ONE_IF_INCR<= '0';
PIXEL_CNTR_COUNT_OVER <= '0';
CNTR_IN <= b"0000";
else
CNTR_IN <= CNTR_IN + 1;

end if;


--if ( CNTR_IN = TC + 1) then
-- CNTR_IN <= b"0000"; -- original value 0001
-- end if;


-- for generating counter count over when TC is greater than 1
-- if ( CNTR_IN = TC) then -- original tc -1
-- PIXEL_CNTR_COUNT_OVER<='1';
-- end if;

--
-- if (CNTR_IN = b"0000") then -- chnaged from 1 to 0
-- COUNT_ONE_IF_INCR<= '1';
-- else
-- COUNT_ONE_IF_INCR<= '0';
-- end if;
end if;

else
PIXEL_CNTR_COUNT_OVER<= '0';
COUNT_ONE_IF_INCR<= '0';
end if;

CNTR<= CNTR_IN;
TC_MINUS_CNTR<= (TC + 2) - CNTR_IN;
SUM_OF_CNTR_AND_TC_MINUS_CNTR <= TC + 2;


end if;
end process;




--- COunter intitial value flag
process( CLK, RESET)
begin
if (RESET ='1') then
COUNT_ONE<= '0';
elsif (CLK ='1' and CLK'event) then
if (CNTR_IN = b"0001") then
COUNT_ONE<= '1';
else
COUNT_ONE<= '0';
end if;
end if;
end process;



--process(CLK, RESET)
--begin
-- if (RESET ='1') then


-- elsif ( CLK ='1' and CLK'event) then


-- -end if;
--end process;

--CNTR <= iCNTR;
--TC_MINUS_CNTR <= iTC_MINUS_CNTR;
--SUM_OF_CNTR_AND_TC_MINUS_CNTR <= iSUM_OF_CNTR_AND_TC_MINUS_CNTR;

end Behavioral;

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The giving that keeps on giving sixteenmillion C Programming 0 11-19-2007 10:59 PM
Counter simulation proper but giving trouble in DFT nisheethg@gmail.com VHDL 1 02-08-2007 07:56 AM
Counter simulation proper but giving trouble in DFT nisheethg@gmail.com VHDL 0 02-08-2007 05:48 AM
CA - DFT Manager Position Available stuart@talentlab.com VHDL 0 03-14-2005 07:25 PM
Java Advanced Imaging and DFT Lukasz Indyk Java 1 01-14-2004 04:03 PM



Advertisments
 



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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57