[an error occurred while processing this directive]
Вроде даже меньше элеМентов использует. Правда чуть больше задержка. Но все равно не то. (+)
(«Телесистемы»: Конференция 'Языки описания аппаратуры (VHDL и др.))

миниатюрный аудио-видеорекордер mAVR

Отправлено imsushka 13 апреля 2005 г. 11:26
В ответ на: Хм, оказытся мона. Но вот вопрос, а не возрастет ли задержка между входом и выходом? отправлено imsushka 13 апреля 2005 г. 10:09

Вот полный кусок проги. Это ROR / ROL / ROLC / RORC для 8, 16, 32, 64, 128 и 256 бит. Если бить на процессы то все равно проверка остается. А если делать для каждого размера отдельно то никакой микрухи не хватит.

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned."+";
use work.config.all;
use work.ds0001.all;

entity iu_st5_r is
port (
op : in std_logic_vector(aops_range); -- Alu operation
op1d : in std_logic_vector(IUDrange); -- source operand 1
op1s : in std_logic_vector(size_range); -- size source operand 1
op2d : in std_logic_vector(IUDrange); -- source operand 2
icci : in std_logic_vector(icc_range); -- integer condition codes
res : out std_logic_vector(IUDrange); -- data result
icco : out std_logic_vector(icc_range) -- integer condition codes
);
end;

architecture rotate of iu_st5_r is

begin
p0 : process(op, op1d, op1s, op2d, icci)

variable c : std_logic;
variable o : std_logic;
variable z : std_logic;
variable n : std_logic;
variable ta : std_logic;
variable tb : std_logic;
variable tr : std_logic;
variable a : std_logic_vector(iudrange);
variable tmp : std_logic_vector(iudrange);
variable b : std_logic_vector(7 downto 0);
variable r : std_logic_vector(iudrange);

begin
a := op1d;
b := op2d(7 downto 0);

n := icci(3);
z := icci(2);
o := icci(1);
c := icci(0);

-- opa - left / right
tb := '0';
if (op = ALU_RRC) or (op = ALU_RLC) then
tb := '1';
end if;
-- opc - over carry
if (op = ALU_ROL) or (op = ALU_RLC) then
b := not b;
end if;

if b(7) = '1' then
tr := c;
c := a(127);
if tb = '0' then
tmp(127 downto 0) := a(127 downto 0);
else
tmp(127 downto 0) := a(126 downto 0) & tr;
end if;
case op1s is
when RS_BYTE => a := a; c := tr;
when RS_WORD => a := a; c := tr;
when RS_DWORD => a := a; c := tr;
when RS_QWORD => a := a; c := tr;
when RS_OWORD => a := a; c := tr;
when RS_HWORD => a(size_h) := tmp(127 downto 0) & a(255 downto 128);
when others => a := a; c := tr;
end case;
end if;
if b(6) = '1' then
tr := c;
c := a(63);
if tb = '0' then
tmp(63 downto 0) := a(63 downto 0);
else
tmp(63 downto 0) := a(62 downto 0) & tr;
end if;
case op1s is
when RS_BYTE => a := a; c := tr;
when RS_WORD => a := a; c := tr;
when RS_DWORD => a := a; c := tr;
when RS_QWORD => a := a; c := tr;
when RS_OWORD => a(size_o) := tmp(63 downto 0) & a(127 downto 64);
when RS_HWORD => a(size_h) := tmp(63 downto 0) & a(255 downto 64);
when others => a := a; c := tr;
end case;
end if;
if b(5) = '1' then
tr := c;
c := a(31);
if tb = '0' then
tmp(31 downto 0) := a(31 downto 0);
else
tmp(31 downto 0) := a(30 downto 0) & tr;
end if;
case op1s is
when RS_BYTE => a := a; c := tr;
when RS_WORD => a := a; c := tr;
when RS_DWORD => a := a; c := tr;
when RS_QWORD => a(size_q) := tmp(31 downto 0) & a( 63 downto 32);
when RS_OWORD => a(size_o) := tmp(31 downto 0) & a(127 downto 32);
when RS_HWORD => a(size_h) := tmp(31 downto 0) & a(255 downto 32);
when others => a := a; c := tr;
end case;
end if;
if b(4) = '1' then
tr := c;
c := a(15);
if tb = '0' then
tmp(15 downto 0) := a(15 downto 0);
else
tmp(15 downto 0) := a(14 downto 0) & tr;
end if;
case op1s is
when RS_BYTE => a := a; c := tr;
when RS_WORD => a := a; c := tr;
when RS_DWORD => a(size_d) := tmp(15 downto 0) & a( 31 downto 16);
when RS_QWORD => a(size_q) := tmp(15 downto 0) & a( 63 downto 16);
when RS_OWORD => a(size_o) := tmp(15 downto 0) & a(127 downto 16);
when RS_HWORD => a(size_h) := tmp(15 downto 0) & a(255 downto 16);
when others => a := a; c := tr;
end case;
end if;
if b(3) = '1' then
tr := c;
c := a(7);
if tb = '0' then
tmp(7 downto 0) := a(7 downto 0);
else
tmp(7 downto 0) := a(6 downto 0) & tr;
end if;
case op1s is
when RS_BYTE => a := a; c := tr;
when RS_WORD => a(size_w) := tmp( 7 downto 0) & a( 15 downto 8);
when RS_DWORD => a(size_d) := tmp( 7 downto 0) & a( 31 downto 8);
when RS_QWORD => a(size_q) := tmp( 7 downto 0) & a( 63 downto 8);
when RS_OWORD => a(size_o) := tmp( 7 downto 0) & a(127 downto 8);
when RS_HWORD => a(size_h) := tmp( 7 downto 0) & a(255 downto 8);
when others => a := a; c := tr;
end case;
end if;
if b(2) = '1' then
tr := c;
c := a(3);
if tb = '0' then
tmp(3 downto 0) := a(3 downto 0);
else
tmp(3 downto 0) := a(2 downto 0) & tr;
end if;
case op1s is
when RS_BYTE => a(size_b) := tmp( 3 downto 0) & a( 7 downto 4);
when RS_WORD => a(size_w) := tmp( 3 downto 0) & a( 15 downto 4);
when RS_DWORD => a(size_d) := tmp( 3 downto 0) & a( 31 downto 4);
when RS_QWORD => a(size_q) := tmp( 3 downto 0) & a( 63 downto 4);
when RS_OWORD => a(size_o) := tmp( 3 downto 0) & a(127 downto 4);
when RS_HWORD => a(size_h) := tmp( 3 downto 0) & a(255 downto 4);
when others => a := a; c := tr;
end case;
end if;
if b(1) = '1' then
tr := c;
c := a(1);
if tb = '0' then
tmp(1 downto 0) := a(1 downto 0);
else
tmp(1 downto 0) := a(0) & tr;
end if;
case op1s is
when RS_BYTE => a(size_b) := tmp( 1 downto 0) & a( 7 downto 2);
when RS_WORD => a(size_w) := tmp( 1 downto 0) & a( 15 downto 2);
when RS_DWORD => a(size_d) := tmp( 1 downto 0) & a( 31 downto 2);
when RS_QWORD => a(size_q) := tmp( 1 downto 0) & a( 63 downto 2);
when RS_OWORD => a(size_o) := tmp( 1 downto 0) & a(127 downto 2);
when RS_HWORD => a(size_h) := tmp( 1 downto 0) & a(255 downto 2);
when others => a := a; c := tr;
end case;
end if;
if b(0) = '1' then
tr := c;
c := a(0);
if tb = '0' then
tmp(0) := a(0);
else
tmp(0) := tr;
end if;
case op1s is
when RS_BYTE => a(size_b) := tmp(0) & a( 7 downto 1);
when RS_WORD => a(size_w) := tmp(0) & a( 15 downto 1);
when RS_DWORD => a(size_d) := tmp(0) & a( 31 downto 1);
when RS_QWORD => a(size_q) := tmp(0) & a( 63 downto 1);
when RS_OWORD => a(size_o) := tmp(0) & a(127 downto 1);
when RS_HWORD => a(size_h) := tmp(0) & a(255 downto 1);
when others => a := a; c := tr;
end case;
end if;
r := a;

res <= r;
icco <= n & z & o & c;
end process;
end;

Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru