完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我写了一个VHDL,它应该运行4个显示器,每个显示器显示不同的输出。
第一个显示屏显示来自SW的输入(15 downto 12) 第二次来自SW(11 downto 8) 等等 代码工作没有错误,但只有一个diplay工作。 在我看来,时钟不是应该的功能。 任何人都可以帮助我使用时钟的语法来启用四个显示器? 这是我的代码: -------------------------------------------------- -------------------------------- - 公司: - 工程师: - - 创建日期:02/28/2014 03:55:05 PM - 设计名称: - 模块名称:project_5 - Behavioral - 项目名: - 目标设备: - 工具版本: - 说明: - - 依赖关系: - - 修订: - 修订版0.01 - 创建文件 - 补充评论: - -------------------------------------------------- -------------------------------- 图书馆IEEE; 使用IEEE.STD_LOGIC_1164.ALL; 使用IEEE.STD_LOGIC_unsigned.all; - 如果使用,取消注释以下库声明 - 带有符号或无符号值的算术函数 - 使用IEEE.NUMERIC_STD.ALL; - 如果实例化,则取消注释以下库声明 - 此代码中的任何Xilinx叶子单元格。 - 图书馆UNISIM; - 使用UNISIM.VComponents.all; entity project_5是 --generic(N:integer:= 4); 港口( SW:在STD_LOGIC_VECTOR(15 downto 0); SSEG_CA:输出STD_LOGIC_VECTOR(6 downto 0); SSEG_AN:inout STD_LOGIC_VECTOR(7 downto 0); LED:输入STD_LOGIC_VECTOR(7 downto 0); clk:在STD_LOGIC中; clr:在STD_LOGIC中; dp:输出STD_LOGIC ); 结束项目_5; 建筑行为project_5是 信号位:STD_LOGIC_VECTOR(3 downto 0); 信号s:STD_LOGIC_VECTOR(1 downto 0); 信号aen:STD_LOGIC_VECTOR(3 downto 0); 信号clkdiv:STD_LOGIC_VECTOR(19 downto 0); 开始 s'0'); elsif clk'event和clk ='1'然后 clkdiv SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA SSEG_CA数位数字位数 LED(3 downto 0) LED(3 downto 0) LED(3 downto 0) LED(3 downto 0) LED(3 downto 0) LED(7 downto 4) - 没有LED(7 downto 4) - 没有LED(7 downto 0) LED(7 downto 4) LED(7 downto 4) 以上来自于谷歌翻译 以下为原文 Hi, I wrote a VHDL thats supposed to run 4 displays simultnasly with each display showing different output. the first display shows the input from SW(15 downto 12) the second from SW(11 downto 8) etc. The code works without errors, but only one diplay is working. It seems to me that the clock is not functiong as it should. can anyone help me with the syntax of the clock to enable four displays? Here is my code: ------------------------------------------------------------------------------------ Company: -- Engineer: -- -- Create Date: 02/28/2014 03:55:05 PM-- Design Name: -- Module Name: project_5 - 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 leaf cells in this code.--library UNISIM;--use UNISIM.VComponents.all;entity project_5 is--generic (N: integer := 4); port( SW : in STD_LOGIC_VECTOR(15 downto 0); SSEG_CA : out STD_LOGIC_VECTOR (6 downto 0); SSEG_AN : inout STD_LOGIC_VECTOR (7 downto 0); LED : inout STD_LOGIC_VECTOR(7 downto 0); clk : in STD_LOGIC; clr : in STD_LOGIC; dp: out STD_LOGIC ); end project_5; architecture Behavioral of project_5 issignal digit: STD_LOGIC_VECTOR ( 3 downto 0);signal s:STD_LOGIC_VECTOR ( 1 downto 0);signal aen: STD_LOGIC_VECTOR ( 3 downto 0);signal clkdiv: STD_LOGIC_VECTOR ( 19 downto 0);begins <= clkdiv(19 downto 18);aen <= "1111";dp <= '1';clock: process(clk, clr)begin if clr = '1' then clkdiv <= (others => '0'); elsif clk'event and clk = '1' then clkdiv <= clkdiv +1; end if; end process; -- representaion on 7seg displaysegrep: process(digit)begin case digit is when "0000" => SSEG_CA <= "1000000"; --0 when "0001" => SSEG_CA <= "1111001"; --1 when "0010" => SSEG_CA <= "0100100"; --2 when "0011" => SSEG_CA <= "0110000"; --3 when "0100" => SSEG_CA <= "0011001"; --4 when "0101" => SSEG_CA <= "0010010"; --5 when "0110" => SSEG_CA <= "0000010"; --6 when "0111" => SSEG_CA <= "1111000"; --7 when "1000" => SSEG_CA <= "0000000"; --8 when "1001" => SSEG_CA <= "0010000"; --9 when "1010" => SSEG_CA <= "0001000"; --A when "1011" => SSEG_CA <= "0000011"; --b when "1100" => SSEG_CA <= "1000110"; --C when "1101" => SSEG_CA <= "0100001"; --d when "1110" => SSEG_CA <= "0000110"; --E when others => SSEG_CA <= "0001110"; --F end case; end process;-- Select displayselan: process(s, aen)begin SSEG_AN <= "11111111"; if aen (conv_integer(s)) = '1' then SSEG_AN(conv_integer(s)) <= '0'; end if;end process;pnew: process(s, SW)begin case s is when "00" => digit <= SW(15 downto 12); when "01" => digit <= SW(11 downto 8); when "10" => digit <= LED(3 downto 0); when others => digit <= LED(7 downto 4); end case; end process; p3: process(SW, LED)begincase SW(1 downto 0) iswhen "00" => LED(3 downto 0) <= SW(15 downto 12) + SW(11 downto 8);when "01" => LED(3 downto 0) <= SW(15 downto 12) - SW(11 downto 8);when "10" => LED(3 downto 0) <= SW(15 downto 12) AND SW(11 downto 8);when "11" => LED(3 downto 0) <= SW(15 downto 12) OR SW(11 downto 8);when others => LED(3 downto 0) <= "0000"; end case;case SW(3 downto 2) iswhen "00" => LED(7 downto 4) <= LED(3 downto 0);when "01" =>-- no LED(7 downto 4) <= LED(6 downto 0) & LED(7); LED(7 downto 4) <= LED(7) & LED(6 downto 4) ;when "10" => -- no LED(7 downto 0) <= LED(0) & LED(7 downto 1); LED(7 downto 4) <= LED(7 downto 5) & LED(4); when "11" => LED(7 downto 4) <= NOT(LED (7 downto 4));when others => LED(7 downto 4) <= "0000"; end case; end process;end Behavioral; |
|
相关推荐
4个回答
|
|
嗨,
了解您正在使用哪个电路板会很有帮助。 (所以我们了解时钟频率,原理图等) 此外,通常在这种情况下,原因可能是UCF文件中的某些不匹配。 所以请再次检查它,并检查它是否真正被实现流程正确使用。 模拟怎么样? 你做完了吗? 它是否按预期工作? 有一个很好的综合 Eilert 以上来自于谷歌翻译 以下为原文 Hi, it would be helpful to know which board you are using. (So we get an idea about the clock frequency, schematic etc.) Also, often in such cases the cause might be some mismatch in the UCF file. So please check it again and also check wether it is really used correctly by the implementation flow. How about simulation? Have you done it? Did it work as intended? Have a nice synthesis Eilert |
|
|
|
嗨Eliert,
我正在使用的是nexys4,型号:xc7a100tcsg324-1 附件是UCF文件。 我确实模拟了它,时钟没有按预期运行,因为时间线上没有起伏。 谢谢, 阿拉维 Constraint_Lab1.xdc 39 KB 以上来自于谷歌翻译 以下为原文 Hi Eliert, The board am using is nexys4, model: xc7a100tcsg324-1 Attached is the UCF file. I did simulate it, and the clock did'nt behave as expected as there was no ups and downs int the timeline. Thanks, Alawi Constraint_Lab1.xdc 39 KB |
|
|
|
嗨,
你是怎么模拟它的? 你创建了一个测试平台吗? 在模拟中,您需要提供输入信号(包括时钟复位等)。 使用HDL测试平台或使用模拟器工具的tcl命令。 UCF文件(或它的Vivado等效)似乎没问题。 无论如何它可能都是提供的。 您是否在HDL中使用匹配的信号名称? 有一个很好的综合 Eilert 以上来自于谷歌翻译 以下为原文 Hi, how did you simulate it? Have you created a testbench? In simulations the input signals (including clock reset etc.) need to be provided by you. Either using a HDL testbench or using the tcl commands of the simulator tool. The UCF file (or it's Vivado equivalent) seems to be OK. Probably it was provided anyway. Do you use matching signal names in your HDL sorce ? Have a nice synthesis Eilert |
|
|
|
在vivado 2013.4中,有一个模拟工具可以创建运行模拟的所有内容。
这就是我用过的东西。 我试图建立一个测试分支,但源向导中没有这样的选项 以上来自于谷歌翻译 以下为原文 In vivado 2013.4 there is a simulation tool that creates everything to run the simulation. Thats what I used. I tried to make a test branch, but there is no such option in the source wizard |
|
|
|
只有小组成员才能发言,加入小组>>
2415 浏览 7 评论
2821 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2292 浏览 9 评论
3372 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2458 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
1084浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
579浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
441浏览 1评论
2000浏览 0评论
723浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 15:05 , Processed in 1.448980 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号