完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,我遇到了非常奇怪的问题。
如果我制作两个状态机名称: 类型状态是(IDLE,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,DONE,DONE2,DECA,FIRST_STAGE,DECB,SECOND_STAGE,B0,B1,B2,B3,B4, B5,B6,B7,B8,B9); signal STATE:states:= IDLE; type states2是(IDLE,NEXT_FC,FC0,FC1,FC2,FC3,FC4); signal STATE2:states2:= IDLE; 比每个州都有一个Case语句。 IDLE状态是否会被混淆,因为它用于状态1和状态2? 您是否可以在类型中重用这些名称? 谢谢 C 以上来自于谷歌翻译 以下为原文 Hi I am experiencing very weird issues. If I make two state machines name: type states is (IDLE,A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,DONE, DONE2, DECA,FIRST_STAGE,DECB,SECOND_STAGE,B0,B1,B2,B3,B4,B5,B6,B7,B8,B9); signal STATE : states := IDLE; type states2 is (IDLE,NEXT_FC,FC0,FC1,FC2,FC3,FC4); signal STATE2 : states2 := IDLE; Than have a Case statement for each state. Will the IDLE state get confused because it is used for both State 1 and State 2?? Are you allowed to reuse those names in a type? Thanks C |
|
相关推荐
7个回答
|
|
|
枚举类型中的名称是该类型的本地名称,因此可以在其他类型中重复使用它们。
你展示的是完全合法的。 你说你有“奇怪的问题”。 什么类型的问题,为什么你怀疑STATE和STATE2的值有问题? - Gabor 以上来自于谷歌翻译 以下为原文 The names in an enumerated type are local to that type, so it is fine to re-use them in another type. What you showed is perfectly legal. You said you are having "weird issues." What sort of issues, and why do you suspect something wrong with the values of STATE and STATE2? -- Gabor |
|
|
|
|
|
谢谢G,
你回复我50%以上的问题:)。 我有非常奇怪的问题,我的工程师团队现在已经坚持了大约30个小时。 我们编写了一个NCO模块(生成一个正弦波),所有它都是一个周期的四分之一存储在一个块中,假设600个样本是四分之一。 比数学是增加/减少块rom以产生一个很好的正弦波。 几个月前我们就做了这个逻辑。 它一直在努力。 现在我们添加了使用正弦波表输出但不影响正弦生成的逻辑。 现在,正弦地址随机增加+30或+60(从逻辑分析仪中检索到)。 因此,我们回到较早的逻辑负载,并开始一次添加少量逻辑,直到它中断,因为我们无法通过模拟找到问题。 我们添加逻辑并最终打破,我们回到之前的逻辑负载,然后慢慢添加更小的数量,最终我们添加所有逻辑,它不再中断。 因此,空白区域中不同位置的相同代码将导致我们的正弦生成失败。 我看到一些令我害怕的事情: 我们的工程师在模块中使用了所有不同的库 库IEEE;使用IEEE.STD_LOGIC_1164.ALL;使用IEEE.STD_LOGIC_UNSIGNED.ALL; 使用work.utilities.ALL; 使用IEEE.NUMERIC_STD.ALL; 我有一些使用这些库的模块: 库IEEE;使用IEEE.STD_LOGIC_1164.ALL;使用IEEE.STD_LOGIC_SIGNED.ALL; 使用work.utilities.ALL; 以及使用这些库的一些模块: 库IEEE;使用IEEE.STD_LOGIC_1164.ALL;使用work.utilities.ALL; 使用IEEE.STD_LOGIC_ARITH.ALL;使用IEEE.STD_LOGIC_UNSIGNED.ALL; 我们使用不同的标准在不同的模块中进行+和 - 。 工具14.5 Ise项目导航器是否会引起混淆并开始执行此类行为? 该项目是15000行VHDL,几乎严格在std_logic / std_logic_vector中。 我应该将所有内容更改为Numeric并执行unsigned / signed多数,并仅将其转换为std_logic_vector以获取ip内核吗? 我也在使用VHDL-93标准,因为这是我公司一直以来的方式。 标准可能是我的问题的原因吗? 顺便说一句,我的逻辑编译并传递时间。 以上来自于谷歌翻译 以下为原文 Thanks G, You reply to over 50% of my questions :). I am having very weird issues, that my engineer team has been stuck on for about 30 hours now. We have written an NCO module (Generates a sine wave) and all it is quarter of a cycle is stored in a block rom lets say 600 samples is a quarter. Than math is made to increment/decrement the the block rom to produce a nice sine wave. We made this logic months ago. It has been working. Now we have added logic that uses the output of the sine wave table but doesn't affect the generation of the sine. Now the Sine address are incrementing by +30 or +60 at random times (Retrieved this from logic analyzer). So we go back to an earlier logic load and start adding in small amounts of logic at a time till it breaks, because we couldn't find the issue via simulation. We add logic and eventually it breaks, We go back to the previous logic load that worked and slowly add even smaller amounts and eventually we add all the logic and it no longer breaks. So same code in different spots in the white space will cause our sine generation to fail. I see some things that scare me: 1. Our engineers used all different libraries in modules library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use work.utilities.ALL; use IEEE.NUMERIC_STD.ALL; I have some modules using these libraries: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_SIGNED.ALL; use work.utilities.ALL; And some modules using these libraries: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use work.utilities.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; We do + and - in different modules using different Standards. Will the tools 14.5 Ise project navigator be caused confusion and start doing this type of behavior? The project is 15000 lines of VHDL and almost strictly in std_logic/std_logic_vector. Should I be changing everything to Numeric and doing unsigned/signed majority and only cast it to std_logic_vector for ip cores? I am also using VHDL-93 Standard, because that is the way my company has always done. Could the standard be the cause of my issues? Btw my logic compiles and passes timing. |
|
|
|
|
|
|
|
|
|
|
|
None
以上来自于谷歌翻译 以下为原文 As of right now we are using default settings on the project. I am not really an expert in the tcl commands yet or have even begun to use them. If I use the Project navigator GUI, my -timing is unchecked my -ol is greyed out High -xe is greyed out at none -t is greyed out at 1 Should I check -timing and put extra effort and change the Starting cost table to 2, then 3. See if problems still exist. I have tried another thing: My system runs off a 25 Mhz SSO oscilattor. I have 3 dcms: DCM_SP_inst : DCM_SP generic map ( CLKDV_DIVIDE => 10.0, -- Divide by: 1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5 -- 7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0 or 16.0 CLKFX_DIVIDE => 1, -- Can be any interger from 1 to 32 CLKFX_MULTIPLY => 5, -- Can be any integer from 1 to 32 CLKIN_DIVIDE_BY_2 => FALSE, -- TRUE/FALSE to enable CLKIN divide by two feature CLKIN_PERIOD => 40.0, -- Specify period of input clock CLKOUT_PHASE_SHIFT => "NONE", -- Specify phase shift of "NONE", "FIXED" or "VARIABLE" CLK_FEEDBACK => "1X", -- Specify clock feedback of "NONE", "1X" or "2X" DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS", -- "SOURCE_SYNCHRONOUS", "SYSTEM_SYNCHRONOUS" or -- an integer from 0 to 15 DLL_FREQUENCY_MODE => "LOW", -- "HIGH" or "LOW" frequency mode for DLL DUTY_CYCLE_CORRECTION => TRUE, -- Duty cycle correction, TRUE or FALSE PHASE_SHIFT => 0, -- Amount of fixed phase shift from -255 to 255 STARTUP_WAIT => TRUE) -- Delay configuration DONE until DCM_SP LOCK, TRUE/FALSE port map ( CLK0 => clk_25Mhz, -- 0 degree DCM CLK ouptput CLK180 => open, -- 180 degree DCM CLK output CLK270 => open, -- 270 degree DCM CLK output CLK2X => open, -- 2X DCM CLK output CLK2X180 => open, -- 2X, 180 degree DCM CLK out CLK90 => open, -- 90 degree DCM CLK output CLKDV => open,--clkdiv_15, -- Divided DCM CLK out (CLKDV_DIVIDE) CLKFX => clk125MHz, -- DCM CLK synthesis out (M/D) CLKFX180 => open, -- 180 degree CLK synthesis out LOCKED => clk_lock, -- DCM LOCK status output PSDONE => open, -- Dynamic phase adjust done output STATUS => open, -- 8-bit DCM status bits output CLKFB => clk_25Mhz, -- DCM clock feedback CLKIN => clk,--clk_25Mhz, -- Clock input (from IBUFG, BUFG or DCM) PSCLK => open, -- Dynamic phase adjust clock input PSEN => open, -- Dynamic phase adjust enable input PSINCDEC => open, -- Dynamic phase adjust increment/decrement RST => '0' -- DCM asynchronous reset input ); DCM_SP_inst2 : DCM_SP generic map ( CLKDV_DIVIDE => 2.0, -- Divide by: 1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5 -- 7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0 or 16.0 CLKFX_DIVIDE => 1, -- Can be any interger from 1 to 32 CLKFX_MULTIPLY => 2, -- Can be any integer from 1 to 32 CLKIN_DIVIDE_BY_2 => FALSE, -- TRUE/FALSE to enable CLKIN divide by two feature CLKIN_PERIOD => 8.0, -- Specify period of input clock CLKOUT_PHASE_SHIFT => "NONE", -- Specify phase shift of "NONE", "FIXED" or "VARIABLE" CLK_FEEDBACK => "2X", -- Specify clock feedback of "NONE", "1X" or "2X" DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS", -- "SOURCE_SYNCHRONOUS", "SYSTEM_SYNCHRONOUS" or -- an integer from 0 to 15 DLL_FREQUENCY_MODE => "LOW", -- "HIGH" or "LOW" frequency mode for DLL DUTY_CYCLE_CORRECTION => TRUE, -- Duty cycle correction, TRUE or FALSE PHASE_SHIFT => 0, -- Amount of fixed phase shift from -255 to 255 STARTUP_WAIT => TRUE) -- Delay configuration DONE until DCM_SP LOCK, TRUE/FALSE port map ( CLK0 => open, -- 0 degree DCM CLK ouptput CLK180 => open, -- 180 degree DCM CLK output CLK270 => open, -- 270 degree DCM CLK output CLK2X => clk2x, -- 2X DCM CLK output CLK2X180 => clk180, -- 2X, 180 degree DCM CLK out CLK90 => open, -- 90 degree DCM CLK output CLKDV => open, -- Divided DCM CLK out (CLKDV_DIVIDE) CLKFX => open, -- DCM CLK synthesis out (M/D) CLKFX180 => open, -- 180 degree CLK synthesis out LOCKED => open, -- DCM LOCK status output PSDONE => open, -- Dynamic phase adjust done output STATUS => open, -- 8-bit DCM status bits output CLKFB => clk2x, -- DCM clock feedback CLKIN => clk125MHz, -- Clock input (from IBUFG, BUFG or DCM) PSCLK => open, -- Dynamic phase adjust clock input PSEN => open, -- Dynamic phase adjust enable input PSINCDEC => open, -- Dynamic phase adjust increment/decrement RST => '0' -- DCM asynchronous reset input ); DCM_SP_inst3 : DCM_SP generic map ( CLKDV_DIVIDE => 10.0, -- Divide by: 1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5 -- 7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0 or 16.0 CLKFX_DIVIDE => 1, -- Can be any interger from 1 to 32 CLKFX_MULTIPLY => 2, -- Can be any integer from 1 to 32 CLKIN_DIVIDE_BY_2 => FALSE, -- TRUE/FALSE to enable CLKIN divide by two feature CLKIN_PERIOD => 40.0, -- Specify period of input clock CLKOUT_PHASE_SHIFT => "NONE", -- Specify phase shift of "NONE", "FIXED" or "VARIABLE" CLK_FEEDBACK => "1X", -- Specify clock feedback of "NONE", "1X" or "2X" DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS", -- "SOURCE_SYNCHRONOUS", "SYSTEM_SYNCHRONOUS" or -- an integer from 0 to 15 DLL_FREQUENCY_MODE => "LOW", -- "HIGH" or "LOW" frequency mode for DLL DUTY_CYCLE_CORRECTION => TRUE, -- Duty cycle correction, TRUE or FALSE PHASE_SHIFT => 0, -- Amount of fixed phase shift from -255 to 255 STARTUP_WAIT => TRUE) -- Delay configuration DONE until DCM_SP LOCK, TRUE/FALSE port map ( CLK0 => clk_fb, -- 0 degree DCM CLK ouptput CLK180 => open, -- 180 degree DCM CLK output CLK270 => open, -- 270 degree DCM CLK output CLK2X => open, -- 2X DCM CLK output CLK2X180 => open, -- 2X, 180 degree DCM CLK out CLK90 => open, -- 90 degree DCM CLK output CLKDV => clk_dv, -- Divided DCM CLK out (CLKDV_DIVIDE) CLKFX => open, -- DCM CLK synthesis out (M/D) CLKFX180 => open, -- 180 degree CLK synthesis out LOCKED => open, -- DCM LOCK status output PSDONE => open, -- Dynamic phase adjust done output STATUS => open, -- 8-bit DCM status bits output CLKFB => clk_fb, -- DCM clock feedback CLKIN => clk_25Mhz, -- Clock input (from IBUFG, BUFG or DCM) PSCLK => open, -- Dynamic phase adjust clock input PSEN => open, -- Dynamic phase adjust enable input PSINCDEC => open, -- Dynamic phase adjust increment/decrement RST => '0' -- DCM asynchronous reset input ); Which creates a clk_dv divided by 10 (2.5 MHz, a clk 5X (125 MHz) , and a Clk2x the Clk 5X (250 Mhz), and Clk2x180 of clk 5X (250 Mhz 180) (THIS LAST CLOCK used for ODDR) I tried replacing the external oscillator with a 20 Mhz oscillator and the logic still fails the same way. I do admit I am inexperienced when it comes to timing constraints. I have been doing this work for 3 years now and I have started from scratch with no senior engineer to guide me along. I went through the timing constraints guides and came up with these constraints: NET "clk" TNM_NET = clk_25Mh; TIMESPEC TS_clk_25Mhz = PERIOD "clk_25Mh" 40 ns HIGH 50 %; NET "fpga_bus<4>" TNM_NET = fpga_bus<4>; TIMESPEC TS_fpga_bus_4_ = PERIOD "fpga_bus<4>" 40 ns HIGH 50%; INST "fpga_bus<1>" TNM = FPGA_BUS_INPUT; INST "fpga_bus<2>" TNM = FPGA_BUS_INPUT; INST "fpga_bus<3>" TNM = FPGA_BUS_INPUT; INST "fpga_bus<4>" TNM = FPGA_BUS_INPUT; TIMEGRP "FPGA_BUS_INPUT" OFFSET = IN 10 ns VALID 20 ns BEFORE "fpga_bus<4>" FALLING; NET "fpga_bus<0>" OFFSET = OUT 9 ns AFTER "clk"; And than I assume that the DCM makes the other clock constraints. I am not sure what other constraints I would need. Thank you so much for your time, it is very hard sometimes to figure out a problem if there is no one to give you help or ideas. |
|
|
|
|
|
我可以建议一些事情:
1)确保设置post place&amp; route静态计时属性以生成“详细”报告和“报告无约束路径”。 这将允许您查看可能需要约束的无约束路径的statuc时序。 2)您可以使用SmartXplorer来完成一系列成本表设置。 如果将其设置为运行说10次迭代,并且即使在找到满足时序的解决方案之后运行所有迭代,那么您可以尝试多个构建。 对于每个构建,只需将结果复制到项目并生成编程文件。 再次,如果你经历了其中一些和一些工作而其他工作被打破,那么它指向时序问题,包括时钟域交叉。 如果您在重新合成时只在工作版本和损坏版本之间切换,那么它可能是一个综合问题。 3)如果您还没有这样做,可以尝试使用“新解析器”来查看它是否修复了综合问题(但请参见第2步)。 在综合选项中,在“其他XST命令行选项”下输入: -use_new_parser是的 - Gabor 以上来自于谷歌翻译 以下为原文 I can suggest a few of things: 1) make sure you set the post place&route static timing properties to generate a "Verbose" report and to "Report Unconstrained Paths". This will allow you to look through the statuc timing for Unconstrained paths that might require constraints. 2) you can use SmartXplorer to walk through a series of cost table settings. If you set it to run say 10 iterations, and run all iterations even after it finds a solution that meets timing, then you can get multiple builds to try. For each build, you just copy the results to the project and generate programming file. Again if you walk through a number of these and some work and others are broken, then it points to timing issues, including clock domain crossing. If you only go between working and broken versions when you re-synthesize, then it could be a synthesis problem. 3) If you haven't already done so, you could try using the "new parser" to see if it fixes a synthesis problem (but see step 2 first). In the synthesis options, under "other XST command line options" enter: -use_new_parser yes -- Gabor |
|
|
|
|
|
我做了1并遵循你的过程属性,除了-2速度等级。
我把它保持在-4速度等级。 附件是以下时间报告。 我从来没有使用过Smart Xplorer我会试试。 我还没有尝试过新的解析器,我也会尝试一下。 Cab_X.twx 203 KB 以上来自于谷歌翻译 以下为原文 I did 1 and followed your Process properties except the -2 speed grade. I left it at -4 speed grade. The attachment is the following timing report from it. I have never used Smart Xplorer I will try that. I haven't tried the new parser yet, I will also try that. |
|
|
|
|
|
csholikowski写道:
我们的工程师在模块中使用了所有不同的库 库IEEE;使用IEEE.STD_LOGIC_1164.ALL;使用IEEE.STD_LOGIC_UNSIGNED.ALL; 使用work.utilities.ALL; 使用IEEE.NUMERIC_STD.ALL; 我有一些使用这些库的模块: 库IEEE;使用IEEE.STD_LOGIC_1164.ALL;使用IEEE.STD_LOGIC_SIGNED.ALL; 使用work.utilities.ALL; 以及使用这些库的一些模块: 库IEEE;使用IEEE.STD_LOGIC_1164.ALL;使用work.utilities.ALL; 使用IEEE.STD_LOGIC_ARITH.ALL;使用IEEE.STD_LOGIC_UNSIGNED.ALL; 我们使用不同的标准在不同的模块中进行+和 - 。 工具14.5 Ise项目导航器是否会引起混淆并开始执行此类行为? 在不知道代码中的内容的情况下,您应该始终使用numeric_std优先于std_logic_arith / std_logic_unsigned。 并且你永远不应该在同一个实体中使用两者中的函数/类型/等。 那是一场灾难。 由于某些未知原因,Xilinx模板喜欢包括两者。 该项目是15000行VHDL,几乎严格在std_logic / std_logic_vector中。 我应该将所有内容更改为Numeric并执行unsigned / signed多数,并仅将其转换为std_logic_vector以获取ip内核吗? 重写那么多代码可能是不可能的,虽然有时你需要做一个干净的扫描。 我使用numeric_std进行数字化的东西,只使用最合理的类型,无论是无符号还是带符号或范围整数。 我甚至在实体端口上使用了signed和unsigned。 如果IP内核只有std_logic_vector端口,则必须进行类型转换。 如果可以,更改核心。 在std_logic_vectors上使用std_logic_arith操作是一种至少已过时20年的设计范例。 我也在使用VHDL-93标准,因为这是我公司一直以来的方式。 标准可能是我的问题的原因吗? 顺便说一句,我的逻辑编译并传递时间。 VHDL-93可悲地过时了; XST支持VHDL-2002的许多有用功能。 但只要代码编译,你应该没问题,因为标准主要规定了语法。 ----------------------------是的,我这样做是为了谋生。 以上来自于谷歌翻译 以下为原文 csholikowski wrote:Without knowing what's in the code, you should ALWAYS use numeric_std in preference to std_logic_arith/std_logic_unsigned. And you should NEVER use functions/types/etc from both in the same entity. That's a recipe for disaster. And for some unknown reason, Xilinx templates like to include both. The project is 15000 lines of VHDL and almost strictly in std_logic/std_logic_vector. Should I be changing everything to Numeric and doing unsigned/signed majority and only cast it to std_logic_vector for ip cores?Rewriting that much code might not be possible, although some times you need to do a clean sweep. I do my numeric stuff using numeric_std ONLY with whatever types makes the most sense, be it unsigned or signed or ranged integers. I even use signed and unsigned on entity ports. You will have to do type conversions if IP cores only have std_logic_vector ports. Change the cores, if you can. Using std_logic_arith operations on std_logic_vectors is a design paradigm that is at least twenty years out of date. I am also using VHDL-93 Standard, because that is the way my company has always done. Could the standard be the cause of my issues?VHDL-93 is woefully out of date; a lot of the useful features of VHDL-2002 are supported by XST. But as long as the code compiles, you should be fine, since the standard dictates mostly syntax. ----------------------------Yes, I do this for a living. |
|
|
|
|
只有小组成员才能发言,加入小组>>
3141 浏览 7 评论
3435 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2897 浏览 9 评论
4097 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
3082 浏览 15 评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
1358浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
1196浏览 1评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-11 09:09 , Processed in 0.963513 second(s), Total 84, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1488
