]> AND Private Git Repository - blast.git/blob - lib/implementations/deserializer_3x1_impl.xml
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
nearly finished GroupBlock VHDL gen
[blast.git] / lib / implementations / deserializer_3x1_impl.xml
1 <!DOCTYPE deserializer_3x1>
2 <block_impl ref_name="deserializer_3x1.xml" ref_md5="">
3   <comments>
4     <author lastname="" mail="" firstname=""/>
5     <date creation="2018-01-10"/>
6     <related_files list=""/>
7     <description>gre</description>
8     <notes>gre</notes>
9   </comments>
10   <libraries>
11     <library name="ieee">
12       <package name="std_logic_1164" use="all"/>
13       <package name="numeric_std" use="all"/>
14     </library>
15   </libraries>
16   <architecture>
17 -- Signals
18 signal do_out : std_logic;
19 signal data1_reg : std_logic_vector(in_width-1 downto 0);
20 signal data2_reg : std_logic_vector(in_width-1 downto 0);
21
22 signal count : unsigned(1 downto 0);
23
24 begin
25
26 deser_process : process (@{clk}, @{reset})
27 begin
28 if @{reset} = '1' then
29 count &lt;= to_unsigned(0, 2);
30 data1_reg &lt;= (others => '0');
31 data2_reg &lt;= (others => '0');
32 @{data1_out} &lt;= (others => '0');
33 @{data2_out} &lt;= (others => '0');
34 @{data3_out} &lt;= (others => '0');
35 do_out &lt;= '0';
36
37 elsif rising_edge(@{clk}) then
38
39 do_out &lt;= '0';
40 @{data1_out} &lt;= (others => '0');
41 @{data2_out} &lt;= (others => '0');
42 @{data3_out} &lt;= (others => '0');
43
44 if @{data_in_enb} = '1' then
45
46 if count = 0 then
47 data1_reg &lt;= @{data_in};
48 count &lt;= count + 1;
49 elsif count = 1 then
50 data2_reg &lt;= @{data_in};
51 count &lt;= count + 1;
52 elsif count = 2 then
53 @{data1_out} &lt;= data1_reg;
54 @{data2_out} &lt;= data2_reg;
55 @{data3_out} &lt;= @{data_in};
56 do_out &lt;= '1';
57 count &lt;= to_unsigned(0, 2);
58 end if;
59 end if;
60 end if;
61
62 end process deser_process;
63
64 @{data1_out_enb} &lt;= do_out;
65 @{data2_out_enb} &lt;= do_out;
66 @{data3_out_enb} &lt;= do_out;
67 </architecture>
68   <patterns>
69     <delta value="3"/>
70     <consumption>
71       <input pattern="111" name="data_in_enb"/>
72     </consumption>
73     <production counter="3">
74       <output pattern="0001" name="data1_out_enb"/>
75       <output pattern="0001" name="data2_out_enb"/>
76       <output pattern="0001" name="data3_out_enb"/>
77     </production>
78   </patterns>
79 </block_impl>