-
Notifications
You must be signed in to change notification settings - Fork 5
/
buf_vector.vhd
67 lines (62 loc) · 1.62 KB
/
buf_vector.vhd
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
58
59
60
61
62
63
64
65
66
-- buffer for the vector check node processor
--
-- Copyright 2019 Ahmet Inan <[email protected]>
library ieee;
use ieee.std_logic_1164.all;
use work.ldpc_scalar.all;
use work.ldpc_vector.all;
entity buf_vector is
port (
clock : in std_logic;
wren : in boolean;
addr : in natural range 0 to degree_max-1;
ivsft : in vsft_vector;
ovsft : out vsft_vector;
icsft : in csft_vector;
ocsft : out csft_vector;
icmag : in cmag_vector;
ocmag : out cmag_vector;
iwdf : in boolean;
owdf : out boolean;
iloc : in vector_location;
oloc : out vector_location;
ioff : in vector_offset;
ooff : out vector_offset;
ishi : in vector_shift;
oshi : out vector_shift
);
end buf_vector;
architecture rtl of buf_vector is
type wdfs_array is array (0 to degree_max-1) of boolean;
signal wdfs : wdfs_array;
type locs_array is array (0 to degree_max-1) of vector_location;
signal locs : locs_array;
type offs_array is array (0 to degree_max-1) of vector_offset;
signal offs : offs_array;
type shis_array is array (0 to degree_max-1) of vector_shift;
signal shis : shis_array;
begin
vector_inst : for idx in soft_vector'range generate
scalar_inst : entity work.fub_scalar
generic map (degree_max)
port map (clock, wren, addr,
ivsft(idx), ovsft(idx),
icsft(idx), ocsft(idx),
icmag(idx), ocmag(idx));
end generate;
process (clock)
begin
if rising_edge(clock) then
if wren then
wdfs(addr) <= iwdf;
locs(addr) <= iloc;
offs(addr) <= ioff;
shis(addr) <= ishi;
end if;
owdf <= wdfs(addr);
oloc <= locs(addr);
ooff <= offs(addr);
oshi <= shis(addr);
end if;
end process;
end rtl;