利用Quartus14.1中Qsys工具新建自定义组件时会产生“part-select direction is opposite from prefix index direction”错误,这是由于Qsys生成自定义组件的地址空间时没有考虑hw.tcl文件中限定的地址空间范围,而是按照可用的最大地址空间进行分配导致的。

例如我的自定义组件使用PAD0进行通道选择,而Qsys为PAD0分配了可用的最大地址空间,和其他组件地址空间发生了重叠。

localparam ADDR_RANGE = 'h40000;//最大地址空间
     localparam PAD0 = log2ceil('h40000 - 64'h0); //地址空间错误
2 localparam PAD1 = log2ceil('h10008 - 64'h10000);
localparam PAD2 = log2ceil('h10050 - 64'h10040);
localparam PAD3 = log2ceil('h10090 - 64'h10080);
localparam PAD4 = log2ceil('h100d0 - 64'h100c0);
localparam PAD5 = log2ceil('h20008 - 64'h20000);
     localparam ADDR_RANGE = 'h40000;
localparam RANGE_ADDR_WIDTH = log2ceil(ADDR_RANGE);
localparam OPTIMIZED_ADDR_H = (RANGE_ADDR_WIDTH > PKT_ADDR_W) ||
(RANGE_ADDR_WIDTH == ) ?
PKT_ADDR_H :
PKT_ADDR_L + RANGE_ADDR_WIDTH - ; localparam RG = RANGE_ADDR_WIDTH-;
  if ( {address[RG:PAD0],{PAD0{'b0}}} == 18'h0   ) begin //编译错误在此产生
src_channel = 'b100000;
src_data[PKT_DEST_ID_H:PKT_DEST_ID_L] = ;
end

在计算通道选择时RG的值小于PAD0,这样会导致编译器输出“part-select direction is opposite from prefix index directio”错误(见参考文献2)。

解决方法:

修改

//修正对应的PAD*地址
localparam PAD0 = log2ceil('h10000 - 64'h0);

参考文献:

1.http://www.alterawiki.com/wiki/New_Qsys_Issues中Merlin Address Routers for Custom peripherals,内容如下:

Merlin Address Routers for Custom peripherals
Issue: When generating the system, Merlin address routers are generated ignoring the ExplicitAddressSpan Avalon property. This causes channels to be greater than the complete address space in some cases; for instance, for a system that uses 29 bits of address space (512 MBs), with explicitly using only 16 MBs, Merlin address routers are generated with full 29 bits of address space per channel. Since the complete address space defaults to the size of the address space of the biggest addressable peripheral, this later causes errors in compilation (Verilog errors containing "...part-select direction is opposite from prefix index direction...") and also address space is overlapped with other peripherals with smaller address spaces.
Workaround: Manually edit nios_addr_router.sv files (there will be more of them; they are located under \{nios_name}\synthesis\submodules\ directory in your project directory) and manually set the values of the PADx variables to the desired address space size (ExplicitAddressSpanValue = 2^PADxValue). Do not change the value of the complete address space (RG variable), as this might introduce more problems.

2.http://quartushelp.altera.com/14.0/mergedProjects/msgs/msgs/evrfx2_veri_opposite_direction.htm,内容如下:

Verilog HDL error at <location>: part-select direction is opposite from prefix index direction

(ID: 13437)


CAUSE: In a Verilog Design File (.v) at the specified location, you used a part-select to select a part of a vector; however, in the part-select, the direction from MSB to LSB is reversed from the direction in the declaration of the vector. For example, see the following excerpt of a sample design, which uses a part-select on vector:

module veri_test(in, out);
input [3:0] in;
output [1:0] out;
assign out = in[0:1];
endmodule
ACTION: Use the same direction in the part-select of a vector as is used in the declaration of the vector. For example, in the previous sample design, you can change the assignment to out into the following format:

assign out = in[1:0];

See also:

Section 4 of the IEEE Std. 1364-2001 IEEE Standard Verilog Hardware Description Language manual

Quartus14.1中Qsys创建custom component时编译出错原因的更多相关文章

  1. Visual Studio 2017创建.net standard类库编译出错原因

    正式版上个月已经Release了,从那时到现在经常会收到更新提示,估计问题还不少吧!其中最吸引我的当然是.net standard与.net core. 刚好最近接触.net standard项目,新 ...

  2. MFC关于多线程中传递窗口类指针时ASSERT_VALID出错的另类解决 转

    MFC关于多线程中传递窗口类指针时ASSERT_VALID出错的另类解决   在多线程设计中,许多人为了省事,会将对话框类或其它类的指针传给工作线程,而在工作线程中调用该类的成员函数或成员变量等等. ...

  3. Quartus14.1中Qsys无法更新custom component的问题

    如果对Qsys中custom component进行了改动,如果直接generate HDL无法使改动应用到实际的编译过程,需要对Qsys进行刷新操作,如下:

  4. C#操作word或excel及水晶报表,检索 COM 类工厂中 CLSID 为 {} 的组件时失败,原因是出现以下错误: 80070005

    解决办法一:<转自http://www.cnblogs.com/Sue_/articles/2123372.html> 具体解决方法如下: 1:在服务器上安装office的Excel软件. ...

  5. 检索 COM 类工厂中 CLSID 为 {} 的组件时失败,原因是出现以下错误: 80070005

    检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005.跟踪了一下,结果是将记录导出 ...

  6. 8000401a 错误 ,检索 COM 类工厂中 CLSID 为 的组件时失败,原因是出现以下错误: 8000401a。

    "/"应用程序中的服务器错误. -------------------------------------------------------------------------- ...

  7. asp.net mvc视图中使用entitySet类型数据时提示出错

    asp.net mvc5视图中使用entitySet类型数据时提示以下错误 检查了一下引用,发现已经引用了System.Data.Linq了,可是还是一直提示出错, 后来发现还需要在Views文件夹下 ...

  8. pycharm中每次创建py文件时就自动生成代码头,以及出现SyntaxError:Non-ASCII 。。。问题

    我们在pycharm中执行py文件的时候,可能会出现以下错误 这是因为你没有制定编码格式,这时候你需要在文件最开始制定编码格式,代码如下 #!/user/bin/env python #-*- cod ...

  9. Android开发,Eclipse创建aidl接口时,出错

    Android开发中,当我们需要调用远程Service时,我们一般通过远程接口(RMI)来实现的,而Android的RMI需要AIDL(Android Interface Definition Lan ...

随机推荐

  1. 二分法习题HDU2199

    AC代码 : #include<iostream>#include<cmath>using namespace std;double y;double f(double n){ ...

  2. 【Machine Learning in Action --2】K-近邻算法改进约会网站的配对效果

    摘自:<机器学习实战>,用python编写的(需要matplotlib和numpy库) 海伦一直使用在线约会网站寻找合适自己的约会对象.尽管约会网站会推荐不同的人选,但她没有从中找到喜欢的 ...

  3. Flex4 flashVars 传值

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or ...

  4. 用caffe给图像的混乱程度打分

    Caffe应该是目前深度学习领域应用最广泛的几大框架之一了,尤其是视觉领域.绝大多数用Caffe的人,应该用的都是基于分类的网络,但有的时候也许会有基于回归的视觉应用的需要,查了一下Caffe官网,还 ...

  5. MySQL慢日志查询全解析:从参数、配置到分析工具【转】

    转自: MySQL慢日志查询全解析:从参数.配置到分析工具 - MySQL - DBAplus社群——围绕数据库.大数据.PaaS云,运维圈最专注围绕“数据”的学习交流和专业社群http://dbap ...

  6. perl面向对象

    来源: http://www.cnblogs.com/itech/archive/2012/08/21/2649580.html Perl面向对象     首先让我们来看看有关 Perl 面向对象编程 ...

  7. ligerUI调用$.ligerDialog.open弹出窗口,关闭后无法获取焦点问题

    1:调用父窗口某一个文件框,获取焦点,   parent.window.document.getElementByIdx_x("roleName").focus(); 2:关闭父窗 ...

  8. 50条规则提高PHP开发提高效率技巧

    0.用单引号代替双引号来包含字符串,这样做会更快一些.因为PHP会在双引号包围的字符串中搜寻变量,单引号则不会,注意:只有echo能这么做,它是一种可以把多个字符串当作 参数的“函数”(译注:PHP手 ...

  9. PostConstruct注解

    应用场景:当你需要往Bean里注入一个其父类中定义的属性,而你又无法复写父类的属性或属性的setter方法时 public class UserDaoImpl extends HibernateDao ...

  10. KVO 进阶

    Key-value coding (KVC) 和 key-value observing (KVO) 是两种能让我们驾驭 Objective-C 动态特性并简化代码的机制.在这篇文章里,我们将接触一些 ...