Ctrinh mô phỏng không báo lỗi đâu, bạn thử đi
Thông báo
Collapse
No announcement yet.
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, 16: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, 17:55.
Comment
Bài viết mới nhất
Collapse
-
bởi theidiotcatDưới đây là một số gợi ý để các bạn sinh viên chọn được chiếc laptop phù hợp với nhu cầu, ngân sách và ngành học trong bối cảnh giá linh kiện leo thang kéo theo mức giá laptop liên tục tăng cao.
Bước vào mùa tựu trường năm...-
Channel: Đánh giá sản phẩm DTVN
hôm nay, 11:26 -
-
bởi theidiotcatAMD Ryzen 9 9950X bước sang năm 2026 vẫn là một trong những bộ vi xử lý desktop mạnh mẽ nhất dành cho người dùng phổ thông cao cấp. Dù đã ra mắt từ thế hệ Zen 5 đầu tiên của dòng Ryzen 9000, con chip 16 nhân 32 luồng này vẫn giữ được sức...
-
Channel: Đánh giá sản phẩm DTVN
Hôm qua, 13:58 -
-
bởi theidiotcatTrong thị trường CPU năm 2026, khi các dòng vi xử lý đời mới liên tục ra mắt với những thông số kỹ thuật hào nhoáng, AMD Ryzen 5 7600X vẫn là một cái tên khiến nhiều game thủ và người dùng phổ thông phải cân nhắc kỹ lưỡng. Sau gần hai...
-
Channel: Đánh giá sản phẩm DTVN
Hôm qua, 13:42 -
-
bởi theidiotcatTrong bối cảnh giá linh kiện tăng cao, hiện tại mức giá laptop đã tăng đáng kể so với thời điểm trước cơn sốt AI. Chính vì vậy để lựa chọn được một chiếc laptop đáp ứng tốt nhu cầu vừa học vừa giải trí các bạn sinh viên cần...
-
Channel: Đánh giá sản phẩm DTVN
Hôm qua, 13:33 -
-
bởi theidiotcatViệc lựa chọn một chiếc laptop gaming phù hợp với nhu cầu, ngân sách chưa bao giờ là dễ dàng. Và điều đó càng khó hơn trong năm 2026 khi mà mức giá liên tục tăng.
Nếu bạn chưa biết nên chọn một chiếc laptop gaming như thế nào...-
Channel: Đánh giá sản phẩm DTVN
26-06-2026, 10:29 -
-
bởi theidiotcatVới mức ngân sách 20 - 30 triệu đồng trong năm 2026, các bạn sinh viên và dân văn phòng có thể tìm thấy nhiều lựa chọn cao cấp, mạnh mẽ, pin “trâu”, đặc biệt là các mẫu laptop AI hỗ trợ cho học tập và làm việc.
Trong phân...-
Channel: Đánh giá sản phẩm DTVN
26-06-2026, 10:25 -
-
bởi theidiotcatDưới đây là một số mẫu laptop nổi bật trong phân khúc dưới 20 triệu giúp các bạn văn phòng, sinh viên và đặc biệt là tân sinh viên có thể dễ dàng lựa chọn được mẫu laptop phù hợp với nhu cầu và ngân sách của mình.
Thị...-
Channel: Đánh giá sản phẩm DTVN
26-06-2026, 10:07 -
-
bởi theidiotcatViệc chọn mua một bộ máy tính phục vụ cho các nhu cầu làm việc văn phòng và sử dụng cơ bản hàng ngày đang trở nên dễ dàng và tiết kiệm hơn bao giờ hết. Thay vì phải đau đầu trích ngân sách để mua cả vi xử lý lẫn card đồ họa rời...
-
Channel: Đánh giá sản phẩm DTVN
25-06-2026, 11:23 -
-
bởi theidiotcatViệc nâng cấp từ một dàn máy tính cũ lên cấu hình mới luôn khiến nhiều người đắn đo về mức chi phí bỏ ra. Nếu bạn đang tìm kiếm một sự lột xác hoàn toàn về hiệu năng mà vẫn cân đối được dòng tiền, combo giữa vi xử lý Ryzen...
-
Channel: Đánh giá sản phẩm DTVN
25-06-2026, 11:06 -

...
Comment