微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 急求verilog编译错误” declaring global objects is a SystemVerilog feature“

急求verilog编译错误” declaring global objects is a SystemVerilog feature“

时间:10-02 整理:3721RD 点击:
第一个错误:Error (10839): Verilog HDL error at isa.v(13): declaring global objects is a SystemVerilog feature

第二个错误:Error (10228): Verilog HDL error at bpred_1bittable.v(2): module "branchpredict" cannot be declared more than once
软件用的quartus9.1, 尤其第一个错误,我的verilog文件是一个全局的里面都是parameter语句,第二个错误,明明没有重名的模块名,怎么会出现这个错误?

请帖出错误代码。

第一个错误:Error (10839): Verilog HDL error at isa.v(13): declaring global objects is a SystemVerilog feature
你使用了systemverilog 的语法,检查你的代码。
第二个错误
module "branchpredict
重复声明了相同的module branchpredict



    /****************************************************************************
          ISA definition file
  - The MIPS I ISA has a 6 bit opcode in the upper 6 bits.  
  - The opcode can also specify a "class".  There are two classes:
            1.  SPECIAL - look in lowest 6 bits to find operation
            2.  REGIMM - look in [20:16] to find type of branch
****************************************************************************/
/****** OPCODES - bits 31...26 *******/
parameter     OP_SPECIAL      = 6'b000000;
parameter     OP_REGIMM       = 6'b000001;
parameter     OP_J            = 6'b000010;
parameter     OP_JAL          = 6'b000011;
parameter     OP_BEQ          = 6'b000100;
parameter     OP_BNE          = 6'b000101;
parameter     OP_BLEZ         = 6'b000110;
parameter     OP_BGTZ         = 6'b000111;
parameter     OP_ADDI         = 6'b001000;
parameter     OP_ADDIU        = 6'b001001;
parameter     OP_SLTI         = 6'b001010;
parameter     OP_SLTIU        = 6'b001011;
parameter     OP_ANDI         = 6'b001100;
parameter     OP_ORI          = 6'b001101;
parameter     OP_XORI         = 6'b001110;
parameter     OP_LUI          = 6'b001111;
parameter     OP_LB           = 6'b100000;
parameter     OP_LH           = 6'b100001;
parameter     OP_LWL          = 6'b100010;
parameter     OP_LW           = 6'b100011;
parameter     OP_LBU          = 6'b100100;
parameter     OP_LHU          = 6'b100101;
parameter     OP_LWR          = 6'b100110;
parameter     OP_SB           = 6'b101x00;
parameter     OP_SH           = 6'b101x01;
parameter     OP_SWL          = 6'b101010;
parameter     OP_SW           = 6'b101x11;
parameter     OP_SWR          = 6'b101110;
/****** FUNCTION CLASS - bits 5...0 *******/
parameter     FUNC_SLL        = 6'b000000;
parameter     FUNC_SRL        = 6'b000010;
parameter     FUNC_SRA        = 6'b000011;
parameter     FUNC_SLLV       = 6'b000100;
parameter     FUNC_SRLV       = 6'b000110;
parameter     FUNC_SRAV       = 6'b000111;
parameter     FUNC_JR         = 6'b001xx0;
parameter     FUNC_JALR       = 6'b001xx1;
parameter     FUNC_MFHI       = 6'bx10x00;
parameter     FUNC_MTHI       = 6'bx10x01;
parameter     FUNC_MFLO       = 6'bx10x10;
parameter     FUNC_MTLO       = 6'bx10x11;
parameter     FUNC_MULT       = 6'bx11x00;
parameter     FUNC_MULTU      = 6'bx11x01;
parameter     FUNC_div        = 6'bx11x10;
parameter     FUNC_divU       = 6'bx11x11;
parameter     FUNC_ADD        = 6'b100000;
parameter     FUNC_ADDU       = 6'b100001;
parameter     FUNC_SUB        = 6'b100010;
parameter     FUNC_SUBU       = 6'b100011;
parameter     FUNC_AND        = 6'b100100;
parameter     FUNC_OR         = 6'b100101;
parameter     FUNC_XOR        = 6'b100110;
parameter     FUNC_NOR        = 6'b100111;
parameter     FUNC_SLT        = 6'b101010;
parameter     FUNC_SLTU       = 6'b101011;
/****** REGIMM Class - bits 20...16 *******/
parameter     FUNC_BLTZ       = 1'b0;
parameter     FUNC_BGEZ       = 1'b1;
parameter     OP_COP2       = 6'b010010;
parameter     COP2_FUNC_CFC2     = 6'b111000;
parameter     COP2_FUNC_CTC2     = 6'b111010;
parameter     COP2_FUNC_MTC2     = 6'b111011;
parameter     OP_COP0       = 6'b010000;
parameter     COP0_MFC0     = 5'b00000;
parameter     COP0_MTC0     = 5'b00100;
//parameter     FUNC_BLTZAL     = 5'b10000;
//parameter     FUNC_BGEZAL     = 5'b10001;
/******
* Original REGIMM class, compressed above to save decode logic
parameter     FUNC_BLTZ       = 5'b00000;
parameter     FUNC_BGEZ       = 5'b00001;
parameter     FUNC_BLTZAL     = 5'b10000;
parameter     FUNC_BGEZAL     = 5'b10001;
*/



    我把代码贴上来了,都是parameter的定义,没接触过systemverilog,还有就是我如果把所有的.v文件都加入到工程库中编译,assignment》seting》libarary,然后编译就没有任何错误了,开始我以为是软件的bug,我从9.1换了10.0和11.0都是同样的错误,后边还有好多,基本都是这两类错误,请高手解惑,谢谢!

这个文件不用加到工程里面,在你用到这些parameter里面加`include编译语句然后指定这个文件所在目录就行了,这个文件让quartuts编译是不能通过的!



    这样啊,谢谢,
请问这个错误“Error (10228): Verilog HDL error at vmem_crossbar.v(5): module "vmem_crossbar" cannot be declared more than once
怎么解决?我只在一个文件中定义了在这个模块名,类似的出现了好几个文件都是这个” cannot be declared more than once“

检查你的代码是不是调用了两次或以上而且调用时例化的名称是一样的!

和小编同样问题Error (10839): Verilog HDL error at barrel_org.v(1): declaring nested module declarations is a SystemVerilog feature,使用include还是无效

建议小编看下#ifdef,#ifndef,#endif的用法,加进去看会不会有这样的问题发生

我也遇到了那两个错误,第一个错误没有解决呢,第二个错误已经解决了,你看一下是不是你的工程名和你的顶层文件名不一致?Quartus里面要求工程文件名和顶层文件名要一样的

实在不行,就把parameter变量全部注释掉,直接赋值

小编,第一个问题解决了吗?我现在也碰到了这个问题

小编,第一个问题解决了没有啊?现在我也遇到了这个问题

小编第一个问题能解决吗?求助

parameter必须定义在module内部

我感觉应该都改成define 语句,'define OP_SPECIAL      6'b011000,parmeter语句不是系统函数,不能那样单独存在吧。

parmeter应是全局参数,同名的只能定义一次,要么你可以使用localparmeter, 作用范围就只在本模块内了。
如果你同名参数在整个工程内都是同一个数字,可以把这些参数都写在一个.vh文件里,然后`include (name).vh就可以了,只用调用一次, 不过要注意下编译顺序,如果你定义的文件在列表里较后位置,可能编译前面时就会报错。

平常不回复,今天特例,顶一下

我也遇到了一样的问题,解决方法是添加`include时,需要把 `include放在module里面,放在外面就会报错。

代码贴全啊,parameter是不是在module外面声明的?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top