信号连接到以下多个驱动器

2023-12-24

我尝试运行以下命令并收到此错误:

这是 Verilog 代码:

module needle( input referrence,input  penalty,output index[7:0]);
//inout input_itemsets;
//input referrence;

//input penalty;
//output index;
parameter max_cols=8;
//
wire index[7:0];
wire referrence;
wire penalty;
//wire input_itemsets;
genvar i,idx;
generate
for( i = max_cols-4 ; i >= 0 ; i=i-1)
    for( idx = 0 ; idx <= i ; idx=idx+1)
        begin
             assign index[i] = (idx + 1) * max_cols + (i + 1 - idx);
             //assign index = (idx + 1) * max_cols + (i + 1 - idx);
            //input_itemsets[index] <= maximum( input_itemsets[index-1-max_cols]+ referrence[index],
            //input_itemsets[index-1] - penalty,
            //input_itemsets[index-max_cols] - penalty);

        end
   endgenerate

endmodule

这是我收到的警告和错误:

WARNING:HDLCompiler:413 - "/home/suriyha/Monajalal/needle_t1/needle.v" Line 39: Result of 4-bit expression is truncated to fit in 1-bit target.
ERROR:HDLCompiler:1401 - "/home/suriyha/Monajalal/needle_t1/needle.v" Line 39: Signal  index[3] in unit needle is connected to following multiple drivers:
Driver 0: output signal of instance Power (PWR_1_o_BUF_9).
Driver 1: output signal of instance Ground (GND_1_o_BUF_8).
Driver 2: output signal of instance Ground (GND_1_o_BUF_6).
Driver 3: output signal of instance Ground (GND_1_o_BUF_4).
Driver 4: output signal of instance Ground (GND_1_o_BUF_11).
Module needle remains a blackbox, due to errors in its contents
WARNING:HDLCompiler:1499 - "/home/suriyha/Monajalal/needle_t1/needle.v" Line 21: Empty module <needle> remains a black box.

然而,主要代码是“分配索引 = (idx + 1) * max_cols + (i + 1 - idx);”但我决定将“index”设置为一个数组来避免这个问题,但是我还没有运行它。因此,无论索引是一个数组还是一个变量,我仍然遇到这个多值问题。

代码的 C 版本是:

for( idx = 0 ; idx <= i ; idx++){
    index = (idx + 1) * max_cols + (i + 1 - idx);
    input_itemsets[index]= maximum( input_itemsets[index-1-max_cols]+ referrence[index],
    input_itemsets[index-1] - penalty,
     input_itemsets[index-max_cols] - penalty);
 }

我还想知道我们是否可以有一个嵌套循环,就像我们在 Verilog 版本中的 C 对应部分中那样,或者如何避免这种情况下的“多驱动程序”问题?

Thanks.


在你的 Verilog 代码中,大多数index位是双驱动常量(x) 或未驱动(z): index[7:0]:zzzxxxx1

解释如下。外层循环是从4到0,意思是index[7:5]未驱动(z)。内循环是从0到i,展开后如下所示:

assign index[4] = (0 + 1) * max_cols + (4 + 1 - 0);
assign index[4] = (1 + 1) * max_cols + (4 + 1 - 1);
...
assign index[1] = (0 + 1) * max_cols + (1 + 1 - 0);
assign index[1] = (1 + 1) * max_cols + (1 + 1 - 1);
assign index[0] = (0 + 1) * max_cols + (0 + 1 - 0);

So index[4:1]是双驱动的(x),并且仅index[0]有一个司机。

编译后的代码和测试如下:电子设计自动化游乐场 http://www.edaplayground.com/s/4/47

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

信号连接到以下多个驱动器 的相关文章

  • 在 g++ 中链接文件

    最近我尝试用g 在Ubuntu上 编译一个程序 通常我使用 Dev C 在 Windows 上 只要我创建一个项目并将所有必要的文件放入其中 它就可以正常工作 编译程序时出现的错误是 filename cpp undefined refer
  • 当我删除 @synthesize 语句时出现编译器错误“使用未声明的标识符”

    在最新的 LLVM 版本中 综合属性的要求已被删除 因此我能够删除我所有的 synthesize声明 除了以下声明NSFetchedResultsController 有谁知道为什么当我删除时编译器会警告我 synthesize fetch
  • C - '=' 标记之前的预期表达式...在没有 '=' 的行上

    我疯狂地试图找出这个与现实 我的代码没有明显联系的错误消息 我一直在这里搜索并得出一个结论 你会讨厌 typedef 隐藏的指针 抱歉 这超出了我的控制范围 教授以这种方式提供了代码 我正在编辑问题中指定的代码 我弹出完整节点以避免每个推送
  • 如何修复实例上的错误:未定义的变量 B?

    我想编译此 Verilog 代码 但在实例中出现错误B模块中的MultiP module error 1 Undefined variable B error 2 near Adder1 syntax error unexpected ID
  • 如何在Qt中设置编译器?

    我对 Qt 完全陌生 我下载了离线版本 Qt 5 3 2 for Windows 64 bit VS 2013 OpenGL 573 MB 我无法编译我的项目 I have Qt Creator 3 2 1 开源 基于Qt 5 3 2 MS
  • 重复的 AssemblyVersion 属性

    我有一个项目在编译时生成以下错误 错误 CS0579 重复的 AssemblyVersion 属性 我已经检查过文件AssemblyInfo cs看起来那里没有重复 I found MSDN 上的这篇文章 http social msdn
  • 未定义条件编译符号

    我无法让 Visual Studio 按照我的预期运行 我创建了 2 个配置文件 一个定义了符号 FOO 另一个定义了符号 BAR 我有这个代码 static class MyClass if FOO public static strin
  • f951 错误:无法识别的命令行选项

    我在linux上 正在编译以下内容 mpif90 shared source F90 object1 o object2 o L some path Qoption link rpath some path I some path lhdf
  • Android Manifest 自动生成无效权限

    我不小心在 Android 清单中输入了无效的权限名称 并且无法将其删除 这是我的清单代码
  • 用于安装 R 软件包的备用编译器:clang:错误:不支持的选项“-fopenmp”

    我正在尝试在 OS X 10 11 6 上使用 R 版本 3 4 0 安装 rJava 包 install packages rJava type source 我收到以下错误 clang o libjri jnilib Rengine o
  • Java编译错误:包不存在

    在我的工作区 wsPrivate 中 我有 3 个 gradle 项目 刽子手 像素视图 Reports PixelView 和 Reports 项目编译良好 然而 Hangman 使用这两个项目 并且有些在编译时找不到包 请参阅以下错误
  • Haskell 为替代的 Either 数据类型定义 Functor 实例

    通过 Typeclassopedia 获得一些使用类型类的路由 想要替代Either的一个实例Functor 但即使检查定义Either作为一个例子Functor总是给我带来麻烦 有这个 但不会编译 data Alt a b Success
  • 如何使用 cython 编译扩展?

    我正在尝试从示例页面编译一个简单的 cython 扩展here http docs cython org src userguide tutorial html在我安装了 Python 2 6 64 位版本的 Windows 7 64 位计
  • 错误:-march= 开关的值错误

    我写了一个Makefile 但无法让它工作 我有一个选项应该选择编译到哪个处理器 然而 当我跑步时make从命令行它说 tandex tandex P 6860FX emulators nintendo sdks 3DS SDK HomeB
  • VHDL - ror 和 rol 操作

    我怎么解决这个问题 reg 变量定义为 signal reg STD LOGIC VECTOR 7 downto 0 00000001 下面代码中ror操作有问题 错误信息是 Line 109 Syntax error near ror L
  • 隐式类型转换 - 编译器错误

    这个问题与this https stackoverflow com questions 3529449 can i make the ternary operator treat my class like a bool问题 下面的代码在V
  • 使用SDL和g++编译找不到-lSDLmain等

    我一直在尝试使用g 来用SDL编译程序 该程序只是一个 main cpp 文件 其中有两条 SDL 测试行 如下所示 include SDL SDL h using namespace std int main void SDL Init
  • 仿真输出全为零

    我的设计模块和测试平台代码已编译 但是 当我模拟时 我没有得到正确的输出 谁能告诉我我的代码哪里出了问题 这是测试平台的代码 module testbench reg 511 0 FROM LS reg CLK reg 63 0 TO IF
  • IntelliJ Idea,运行代码而不管不相关的项目文件中的错误

    我在 Eclipse 中错过的一件事是 如果我的项目中一些完全不相关的文件包含错误 我将无法运行用于测试各种事物的代码 想想简短的 main 我在 FAQ 中读到 我可以使用带有 proceedOnErrors 参数的 Eclipse 编译
  • 如果函数在类范围内声明,则 constexpr 不起作用[重复]

    这个问题在这里已经有答案了 我使用的是 g 4 8 0 它不包含早期版本constexpr漏洞 因此下面的代码有效fine http ideone com YkmUDJ constexpr int size return 5 int arr

随机推荐