Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - probleme in code

 
Thread Tools Search this Thread
Old 05-28-2006, 12:43 PM   #1
Default probleme in code


hi
i m tring to implement the blowfish encryption algorithm.i m trying to implement the array which has values in it and writes it again to the same location after some mathematical function . fot this i used unsigned type values it works fine whn i check synstex and didnt give any error but whn i try to generate test bench it gives error Error like below::

and also attaching my code as welll

parray.vhd(66): (vcom-1137) Identifier 'unsigned' is not visible. Making two objects with the name 'unsigned' directly visible via use clauses results in a conflict; neither object is made directly visible. (LRM Section 10.4)
# Definitions included from:
# ieee.std_logic_arith.unsigned
# ieee.numeric_std.unsigned
# ** Error: parray.vhd(69): VHDL Compiler exiting
# ** Error: C:/Modeltech_xe_starter/win32xoem/vcom failed.
# Executing ONERROR command at macro ./testbench.ado line 9
ERROR: VSim failed to simulate annotated testbench



code :::
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;


entity parray_control is
port (
clk : in std_logic;

init_parray : in bit; -- tells us to initialize the parray
sub_parray : in bit; -- tells us to run the zero_block through

sub_parray_done : out bit;

sboxes_zero_block : out unsigned(63 downto 0); -- to sboxes_control

parray_init_addr : buffer unsigned(4 downto 0);
parray_init_chunk : out unsigned(31 downto 0);
parray_init_data : in unsigned(31 downto 0);
parray_addr : out unsigned(4 downto 0);
parray_data_in : out unsigned(31 downto 0);
parray_data_out : in unsigned(31 downto 0);
parray_we : out bit;
parray_crypt_go : out bit;
parray_crypt_ptext : out unsigned(63 downto 0);

crypt_ctext : in unsigned(63 downto 0);
crypt_parray_addr : in unsigned(4 downto 0);
crypt_parray_data : out unsigned(31 downto 0);
crypt_done : in bit;

keychunk_blob : in unsigned(447 downto 0)

);
end parray_control;

architecture fishy of parray_control is

type PARRAY_STATES is (PASS, INIT, SUB, SUB_WRITE1, SUB_WRITE2);
signal parray_state : PARRAY_STATES;

type KEYCHUNK_TYPE is array (0 to 13) of unsigned(31 downto 0);
signal keychunk : KEYCHUNK_TYPE;

signal zero_block : unsigned(63 downto 0);

begin

-- split up the blob into the chunks we just selected
keychunk(0) <= keychunk_blob(31 downto 0);
keychunk(1) <= keychunk_blob(63 downto 32);
keychunk(2) <= keychunk_blob(95 downto 64);
keychunk(3) <= keychunk_blob(127 downto 96);
keychunk(4) <= keychunk_blob(159 downto 12;
keychunk(5) <= keychunk_blob(191 downto 160);
keychunk(6) <= keychunk_blob(223 downto 192);
keychunk(7) <= keychunk_blob(255 downto 224);
keychunk( <= keychunk_blob(287 downto 256);
keychunk(9) <= keychunk_blob(319 downto 28;
keychunk(10) <= keychunk_blob(351 downto 320);
keychunk(11) <= keychunk_blob(383 downto 352);
keychunk(12) <= keychunk_blob(415 downto 384);
keychunk(13) <= keychunk_blob(447 downto 416);

-- process to control parray initialization
process(clk, parray_state, init_parray, crypt_done, parray_init_addr,
sub_parray, keychunk)
variable just_started : std_logic;
begin
if (clk'event AND clk = '1') then
sub_parray_done <= '0';
if (parray_state = SUB) then
if (crypt_done = '1' AND just_started = '0') then
parray_state <= SUB_WRITE1;
--parray_init_addr - don't modify it
parray_init_chunk <= (others => '0');
parray_crypt_go <= '0';
else
just_started := '0';
parray_state <= SUB;
--parray_init_addr - don't modify it
parray_init_chunk <= (others => '0');
parray_crypt_go <= '0';
end if;
elsif (parray_state = SUB_WRITE1) then
parray_state <= SUB_WRITE2;
parray_init_addr <= parray_init_addr + 1;
parray_init_chunk <= (others => '0');
parray_crypt_go <= '0';
elsif (parray_state = SUB_WRITE2) then
if (parray_init_addr = 17) then
parray_state <= PASS;
parray_crypt_go <= '0';
else
parray_state <= SUB;
parray_crypt_go <= '1';
end if;
parray_init_addr <= parray_init_addr + 1;
parray_init_chunk <= (others => '0');
just_started := '1'; -- so we don't write two in a row!
elsif (sub_parray = '1') then
parray_state <= SUB;
parray_init_addr <= (others => '0');
parray_init_chunk <= (others => '0');
parray_crypt_go <= '1';
just_started := '1';
elsif (parray_state = INIT) then
if (parray_init_addr = 17) then
parray_state <= PASS;
else
parray_state <= INIT;
end if;
parray_init_addr <= parray_init_addr + 1;
case parray_init_addr is
when "00000" => parray_init_chunk <= keychunk(1);
when "00001" => parray_init_chunk <= keychunk(2);
when "00010" => parray_init_chunk <= keychunk(3);
when "00011" => parray_init_chunk <= keychunk(4);
when "00100" => parray_init_chunk <= keychunk(5);
when "00101" => parray_init_chunk <= keychunk(6);
when "00110" => parray_init_chunk <= keychunk(7);
when "00111" => parray_init_chunk <= keychunk(;
when "01000" => parray_init_chunk <= keychunk(9);
when "01001" => parray_init_chunk <= keychunk(10);
when "01010" => parray_init_chunk <= keychunk(11);
when "01011" => parray_init_chunk <= keychunk(12);
when "01100" => parray_init_chunk <= keychunk(13);
when "01101" => parray_init_chunk <= keychunk(0);
when "01110" => parray_init_chunk <= keychunk(1);
when "01111" => parray_init_chunk <= keychunk(2);
when others => parray_init_chunk <= keychunk(3);
end case;
parray_crypt_go <= '0';
elsif (init_parray = '1') then
parray_state <= INIT;
parray_init_addr <= (others => '0');
parray_init_chunk <= keychunk(0);
parray_crypt_go <= '0';
else -- if we're not initializing, just pass-through
parray_state <= PASS;
parray_init_addr <= (others => '0');
parray_init_chunk <= (others => '0');
parray_crypt_go <= '0';
sub_parray_done <= '1';
end if;
end if;
end process;

-- process to control the zero_block used in initalizations
process(clk, parray_state, zero_block, crypt_ctext, sub_parray)
begin
if (clk'event AND clk = '1') then
if (parray_state = SUB_WRITE1) then
zero_block <= crypt_ctext;
sboxes_zero_block <= crypt_ctext;
elsif (sub_parray = '1') then
zero_block <= (others => '0');
end if;
end if;
parray_crypt_ptext <= zero_block;
end process;


crypt_parray_data <= parray_data_out;

-- process to allow parray init or passthrough to crypt
process(parray_state, parray_init_addr, parray_init_data, crypt_parray_addr,
crypt_ctext)
begin
if (parray_state = SUB_WRITE1) then
parray_we <= '1';
parray_addr <= parray_init_addr;
parray_data_in <= crypt_ctext(63 downto 32);
elsif (parray_state = SUB_WRITE2) then
parray_we <= '1';
parray_addr <= parray_init_addr;
parray_data_in <= crypt_ctext(31 downto 0);
elsif (parray_state = INIT) then
parray_we <= '1';
parray_addr <= parray_init_addr;
parray_data_in <= parray_init_data;
else
parray_we <= '0';
parray_addr <= crypt_parray_addr;
parray_data_in <= (others => '0');
end if;
end process;

end;


chinmay shah
chinmay shah is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Access HTML elements in code behind??? nedums_b Software 1 02-07-2008 07:15 PM
Circumvent Region Code hufaunder@yahoo.com DVD Video 11 01-29-2007 09:51 PM
Probelm For Runing This Code farhad13841384 Software 0 08-03-2006 07:32 AM
.avi files giving region code error Craig Cameron DVD Video 2 03-07-2006 02:49 PM
DVD Verdict reviews: PURGATORY, BAD BOY BUBBY, EXPLORING THE DA VINCI CODE, and more! DVD Verdict DVD Video 1 06-25-2005 12:51 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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