利用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. UTF8,UTF16,UTF32,UTF16-LE,UTF16-BE,GBK 之间的转换

    Unicode是Unicode.org制定的编码标准,目前得到了绝大部分操作系统和编程语言的支持.Unicode.org官方对Unicode的定义是:Unicode provides a unique ...

  2. Linq第一讲

    在说LINQ之前必须先说说几个重要的C#语言特性 一:与LINQ有关的语言特性 1.隐式类型 (1)源起 在隐式类型出现之前,在声明一个变量的时候, 总是要为一个变量指定他的类型甚至在foreach一 ...

  3. office2003

    key:

  4. 认识cookie与session的区别与应用

    通常我们所说的浏览器自动保存密码,下次不用登陆,网页换皮肤,用户引导,提示一次就不再出现的内容,大部分通过cookie或者session来实现的,在这次制作用户引导中,本人就用到了cookie的内容, ...

  5. LR的VG与Control之间的关系,并发的实质

    LR的VG与Control之间的关系,经过无数次的实验,搞清楚了现实意义的并发.传说每秒有几百,几千,几万用户并发,基本属于设想状态. 在一秒内处理多少个请求,完全在于服务器处理能力的强弱.这里需要强 ...

  6. ueditor浏览器 无法上传文件.问题

    dll也都引用了 路径绝对tmd没问题 最后 我一点一点的调试发现了问题 草tmd百度程序员 */UE.ajax = function() { //创建一个ajaxRequest对象 var fnSt ...

  7. Django urls常用匹配语法

    url from django.conf.urls import url from . import views urlpatterns = [ url(r'^articles/2003/$', vi ...

  8. Spring Boot 系列教程16-数据国际化

    internationalization(i18n) 国际化(internationalization)是设计和制造容易适应不同区域要求的产品的一种方式. 它要求从产品中抽离所有地域语言,国家/地区和 ...

  9. bios自检时间长,显示0075错误

    一amibios主板,只有一IDE接口,接一硬盘一光驱,每次启动时,在bios自检界面,在检测完usb设备后,都要等个那么一两分钟,这个时候,可以在屏幕的右下角看到有数字:0075 ,这就是错误代码. ...

  10. CDockablePane 记忆界面布局的问题

    CWinAppEx类的LoadCustomState()和SaveCustomState()用于向注册表读取和保存应用程序的界面信息,重载该方法可以取消自动记忆界面布局. void CxxxApp:: ...