OpenCores
URL https://opencores.org/ocsvn/neural_net_perceptron/neural_net_perceptron/trunk

Subversion Repositories neural_net_perceptron

[/] [neural_net_perceptron/] [trunk/] [rtl/] [vhdl/] [p0300_m00103_s_v01_mem_s.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 fpga_is_fu
-- COPYRIGHT (C) 2022 by Jens Gutschmidt / VIVARE GmbH Switzerland
2
-- (email: opencores@vivare-services.com)
3
-- 
4
-- This program is free software: you can redistribute it and/or modify it
5
-- under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or any
7
-- later version.
8
-- 
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
-- See the GNU General Public License for more details.
13
-- 
14
-- You should have received a copy of the GNU General Public License
15
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
-- 
17
-- 
18
-- Versions:
19
-- 
20
-- Revision 1.0  2022/06/12
21
-- -- First draft
22
-- 
23
LIBRARY ieee;
24
USE ieee.std_logic_1164.all;
25
USE ieee.std_logic_arith.all;
26
--USE ieee.numeric_std.all;
27
LIBRARY work;
28
USE work.memory_vhd_v03_pkg.all;
29
 
30
LIBRARY work;
31
 
32
entity p0300_m00103_s_v01_mem_s is
33
   port(
34
      clk_i      : in     std_logic;         -- Single Clock Input
35
      we_i       : in     std_logic;         -- Write Enable Input
36
      d_i        : in     DATA_T;            -- Data Input
37
      addr_i     : in     ADDRESS_S_T;       -- Address Input
38
      d_o        : out    DATA_T             -- Data Output 
39
   );
40
end entity p0300_m00103_s_v01_mem_s;
41
 
42
--
43
architecture p0300_mem_s_arch of p0300_m00103_s_v01_mem_s is
44
 
45
  signal addr_reg   : ADDRESS_S_T;             -- Address register
46
  signal din_reg    : DATA_T;
47
  signal we_reg     : std_logic;
48
  signal s_ram      : S_RAM_T;                    -- "s input" memory array
49
  attribute logic_block : boolean;
50
  attribute logic_block of s_ram : signal is true;
51
 
52
 
53
begin
54
 
55
  mem_s_proc: process (clk_i)
56
  begin
57
     if (clk_i'event and clk_i='1') then
58
        if (we_reg = '1') then
59
           s_ram(CONV_INTEGER(unsigned(addr_i))) <= din_reg;
60
        end if;
61
        addr_reg  <= addr_i;
62
        din_reg   <= d_i;
63
        we_reg    <= we_i;
64
     end if;
65
  end process mem_s_proc;
66
  d_o <= s_ram(CONV_INTEGER(unsigned(addr_reg)));
67
 
68
end architecture p0300_mem_s_arch;
69
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.