Ctrinh mô phỏng không báo lỗi đâu, bạn thử đi
thiết kê FIFO dựa trên synch dual port ram
Collapse
X
-
ERROR:Xst:2070 - If you are attempting to describe a dual-port block RAM with two separate write ports for signal <mem>, please use a shared variable instead. Coding guidelines are provided in the user manual.Nguyên văn bởi jefflieu Xem bài viếtCtrinh mô phỏng không báo lỗi đâu, bạn thử đi
-->
Tình hình là thế này, nếu viết độc lập code của em viết trong 1 project thì nó hiện ra lỗi này, còn nếu viết trong 1 project mà nó không phải thành phần chính , tức là cái project này là cho cái code trên mạng kia, nhưng em tạo thêm 1 cái new source nữa và dán code do em viết ra( em có thói quen là nhưng cái nào gần giống nhau, kiểm ram như thế này thì em cho vào 1 project) thì khi tổng hợp lại không bị lỗi ????Last edited by boyzzun; 19-06-2014, 15:11.
Comment
-
Trong 2 processes:
always@(posedge clk)
begin
if(ce1='1')
A <= B&C;
end
always@(posedge clk)
begin
if(ce2='1')
A <= D & F;
end
Ở cái process 1, sẽ sinh ra 1 Flip-flop (thành phần cơ bản tren FPGA), cổng CE của Flop sẽ nối với cổng ce1, cổng D nối với đầu ra của cổng AND = B & C.
Ở cái process 2, sẽ sinh ra 1 flip-flop, cổng CE nối với ce2, ...v.v
Mà bạn cho 2 Flip flop này cùng 1 tên A, nên nó bị chỏi ... không synthesize được ...
Bạn search "HDL Coding Guidelines Xilinx" rồi đọc tài liệu ...
Comment
-
Mô phỏng thì lại được ??? cũng hơi là nhỉ em làm trên ISENguyên văn bởi jefflieu Xem bài viếtBạn mô phỏng nó đi (dùng Xilinx ISIM hoặc Altera ModelSim)
ak còn cái này nữa là cái fifo mà có sử dụng bộ đếm để tạo ra tín hiệu full hay empty ý, thì cái bộ đếm em tạo ra lại là 1 bộ đếm thông thường dạng tuần hoàn, tức là nó cứ đếm từ 0 tới max rồi lại về 0 rồi đến max, cứ như thế thành ra là không đúng, em đang nghĩ đến việc tạo 1 bộ đếm mà nó chỉ đếm 1 lần (từ 0 đến max rồi không quay về 0 nữa) thì không biết phải làm thế nào
đây là code fifo
đây là testbenchCode:---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 11:14:20 06/19/2014 -- Design Name: -- Module Name: dual_ram2 - Behavioral -- Project Name: -- Target Devices: -- Tool versions: -- Description: -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- ---------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; use ieee.std_logic_unsigned.all; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all; entity dual_ram2 is generic ( addr_ram : integer:=4); port ( clk : in std_logic; addra : in std_logic_vector(3 downto 0); addrb : in std_logic_vector(3 downto 0); data_a : in std_logic_vector(7 downto 0); data_b : in std_logic_vector( 7 downto 0); data_a_out : out std_logic_vector(7 downto 0); data_b_out : out std_logic_vector(7 downto 0); ena : in std_logic; enb : in std_logic; re : in std_logic; wr : in std_logic); end dual_ram2; architecture Behavioral of dual_ram2 is constant ram_depth:integer:=2**addr_ram ; type ram is array(integer range<>) of std_logic_vector(7 downto 0); signal mem : ram( 0 to ram_depth-1); begin process(clk,wr) begin if rising_edge(clk) then if wr='1' and ena='1' then mem(conv_integer(addra))<=data_a; end if; end if; end process; process(clk,re) begin if rising_edge(clk) then if re='1' and enb='1' then data_b_out<=mem(conv_integer(addrb)); end if; end if; end process; end Behavioral; library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity fifo_dual is port ( clk : in std_logic; wr : in std_logic; re : in std_logic; data_in : in std_logic_vector(7 downto 0); data_out : out std_logic_vector(7 downto 0); fifo_full: out std_logic; fifo_empty : out std_logic); end fifo_dual; architecture fpga of fifo_dual is signal c : std_logic_vector(3 downto 0):="0000"; signal we : std_logic; signal rd :std_logic; signal addra : std_logic_vector(3 downto 0):="0000"; signal addrb : std_logic_vector(3 downto 0):="0000"; signal ea : std_logic; signal eb : std_logic; signal full : std_logic; signal empty : std_logic; signal data_inb,data_outb:std_logic_vector(7 downto 0); component dual_ram2 is generic ( addr_ram : integer:=4); port ( clk : in std_logic; addra : in std_logic_vector(3 downto 0); addrb : in std_logic_vector(3 downto 0); data_a : in std_logic_vector(7 downto 0); data_b : in std_logic_vector( 7 downto 0); data_a_out : out std_logic_vector(7 downto 0); data_b_out : out std_logic_vector(7 downto 0); ena : in std_logic; enb : in std_logic; re : in std_logic; wr : in std_logic); end component; begin u1 : dual_ram2 port map (clk=> clk, addra=>addra, addrb=>addrb, data_a=>data_in, data_b=>data_inb, data_a_out=>data_outb, data_b_out=>data_out, ena=>ea, enb=>eb, wr=>wr, re=>re ); full <= '1' when c="1111" else 'Z'; empty <= '1' when c="0000" else 'Z'; fifo_full<=full; fifo_empty<=empty; process(clk,c,addra) begin if rising_edge(clk) then if wr='1' and c="1111" then ea<='0'; else c<=c+1; ea<='1'; addra<=addra+1; end if; if re='1' and c="0000" then eb<='0'; else c<=c-1; eb<='1'; addrb<=addrb+1; end if; end if; end process; --process(clk,c,addrb) -- begin -- if rising_edge(clk) then -- if re='1' then -- if c="0000" then -- eb<='0'; -- else -- c<=c-1; -- eb<='1'; -- end if; -- addrb<=addrb+1; -- end if; -- end if; --end process; end fpga;
Code:-------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 10:24:42 06/21/2014 -- Design Name: -- Module Name: E:/New folder/practice/FIFO_2/FIFO_tb.vhd -- Project Name: FIFO_2 -- Target Device: -- Tool versions: -- Description: -- -- VHDL Test Bench Created by ISE for module: fifo_dual -- -- Dependencies: -- -- Revision: -- Revision 0.01 - File Created -- Additional Comments: -- -- Notes: -- This testbench has been automatically generated using types std_logic and -- std_logic_vector for the ports of the unit under test. Xilinx recommends -- that these types always be used for the top-level I/O of a design in order -- to guarantee that the testbench will bind correctly to the post-implementation -- simulation model. -------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --USE ieee.numeric_std.ALL; ENTITY FIFO_tb IS END FIFO_tb; ARCHITECTURE behavior OF FIFO_tb IS -- Component Declaration for the Unit Under Test (UUT) COMPONENT fifo_dual PORT( clk : IN std_logic; wr : IN std_logic; re : IN std_logic; data_in : IN std_logic_vector(7 downto 0); data_out : OUT std_logic_vector(7 downto 0); fifo_full : OUT std_logic; fifo_empty : OUT std_logic ); END COMPONENT; --Inputs signal clk : std_logic := '0'; signal wr : std_logic := '0'; signal re : std_logic := '0'; signal data_in : std_logic_vector(7 downto 0) := (others => '0'); --Outputs signal data_out : std_logic_vector(7 downto 0); signal fifo_full : std_logic; signal fifo_empty : std_logic; -- Clock period definitions constant clk_period : time := 10 ns; BEGIN -- Instantiate the Unit Under Test (UUT) uut: fifo_dual PORT MAP ( clk => clk, wr => wr, re => re, data_in => data_in, data_out => data_out, fifo_full => fifo_full, fifo_empty => fifo_empty ); -- Clock process definitions clk_process :process begin clk <= '0'; wait for clk_period/2; clk <= '1'; wait for clk_period/2; end process; -- Stimulus process stim_proc: process begin -- hold reset state for 100 ns. wait for clk_period ; wr<='1'; data_in<="00000000"; wait for clk_period; data_in<="00000001"; wait for clk_period; data_in<="00000010"; wait for clk_period; data_in<="00000011"; wait for clk_period; data_in<="00000100"; wait for clk_period; data_in<="00000101"; wait for clk_period; data_in<="00000110"; wait for clk_period; data_in<="00000111"; wait for clk_period; data_in<="00001000"; wait for clk_period; data_in<="00001001"; wait for clk_period; data_in<="00001010"; wait for clk_period; data_in<="00001011"; wait for clk_period; data_in<="00001100"; wait for clk_period; data_in<="00001101"; wait for clk_period; data_in<="00001110"; wait for clk_period; data_in<="00001111"; wait for clk_period; data_in<="11110000"; wait for clk_period; re<='1'; -- insert stimulus here wait; end process; END;Last edited by boyzzun; 21-06-2014, 16:55.
Comment
Bài viết mới nhất
Collapse
-
bởi domar123Trong môi trường vận hành kinh doanh và công việc văn phòng hằng ngày, tính ổn định, độ bền bỉ và chi phí đầu tư luôn là những ưu tiên hàng đầu. Bộ vi xử lý AMD Athlon 3000G cùng phiên bản Athlon 3000G MPK mang lại giải pháp máy tính phổ...
-
Channel: Đánh giá sản phẩm DTVN
21-08-2026, 10:53 -
-
bởi ittcCác bác ơi, có người bày em là nên đăng ký học qua thầy, thầy sẽ nhiệt tình hơn rồi thầy quen biết trong giới thi dễ đậu hơn bla bla, nhưng đã có nhiều vụ thầy nhận tiền xong trốn luôn, hoặc giữa thầy và trung tâm không đồng nhất...-
Channel: Tâm tình dân kỹ thuật
20-08-2026, 19:27 -
-
-
bởi domar123Giải pháp build PC thông minh cho game thủ thực dụng
Khi tự lắp một bộ PC chơi game với ngân sách có hạn, việc chi tiêu hợp lý từng đồng là chìa khóa để đạt hiệu năng thực tế cao nhất. Sử dụng các vi xử lý tích hợp đồ...-
Channel: Đánh giá sản phẩm DTVN
20-08-2026, 10:00 -
-
bởi domar123Giải pháp cho dàn PC cao cấp chơi game và làm việc
Khi xây dựng một bộ máy tính cao cấp, việc chọn đúng vi xử lý và card đồ họa sẽ quyết định trực tiếp đến trải nghiệm thực tế của bạn. Dòng chip AMD trang bị công nghệ...-
Channel: Đánh giá sản phẩm DTVN
18-08-2026, 08:55 -
-
bởi domar123Giải pháp toàn diện cho người dùng đa nhiệm
Nếu bạn đang cần một bộ máy vừa phục vụ công việc chuyên môn nặng vừa đáp ứng nhu cầu giải trí cao cấp, sự kết hợp giữa Ryzen 9 9950X TRAY và Radeon RX 9070 XT 16GB là lựa chọn...-
Channel: Đánh giá sản phẩm DTVN
17-08-2026, 17:12 -
-
bởi lvhnKhác nhau là đi lái thuê hoặc chạy dịch vụ được
...
-
Channel: Tâm tình dân kỹ thuật
17-08-2026, 15:50 -
-
bởi ittcHic, sao nhiều anh em khuyên là đàn ông đã học thì học luôn số sàn chứ đừng học số tự động anh....-
Channel: Tâm tình dân kỹ thuật
16-08-2026, 17:46 -
-
bởi mèomướp1. Tìm hiểu đc thì càng tốt, bận thì thôi. Ko cần quá quan trọng
2. Số tự động cho đơn giản, kiểu như đi xe ga ấy ạ
3. Học lý thuyết tử tế ok
4.ok
5.có. đủ số km, tgian cầm lái là đc
6.đi ăn tập thể,...-
Channel: Tâm tình dân kỹ thuật
14-08-2026, 16:34 -

Comment