4

我有一个用 Verilog 编写的简单控制器,用于配置 Altera 的 TSE MAC。到目前为止,这相当简单。然而,我接下来想做的是设置很多 Marvel PHY 的设置,并继续监控 PHY 和 MAC 的统计数据和错误等。在硬件中这样做似乎有点过头了,所以我决定加入 Nios中央处理器。但在继续在软件中实现组件之前,我想使用 System Console 快速原型化这个想法。无论如何,这是我的 QSys 基础系统:

在此处输入图像描述

调用 MAC 实例,其想法是通过 CPUtse_mac读取/写入来配置它。control_portdata_master

启动并运行系统后,我使用 System Console 连接到它。我认为它通常可以工作,因为它能够获得master服务路径:

% get_service_paths master
{/devices/EP2AGX260@1#7-1/(link)/JTAG/(70:34 v3 #0)/nios2_0}

它也可以正常打开。但是,在尝试写入 32 位值时它会立即失败:

% get_service_paths master
{/devices/EP2AGX260@1#7-1/(link)/JTAG/(70:34 v3 #0)/nios2_0}
% open_service master "/devices/EP2AGX260@1#7-1/(link)/JTAG/(70:34 v3 #0)/nios2_0"

% master_write_32 "/devices/EP2AGX260@1#7-1/(link)/JTAG/(70:34 v3 #0)/nios2_0" 0x400 0x00000000;
error: com.altera.systemconsole.internal.plugin.jtag.oci.Nios2DebugException: Can't do this while target is running
    while executing
"master_write_32 {/devices/EP2AGX260@1#7-1/(link)/JTAG/(70:34 v3 #0)/nios2_0} {0x400} {0x00000000}"
    while executing
"master_write_32 "/devices/EP2AGX260@1#7-1/(link)/JTAG/(70:34 v3 #0)/nios2_0" 0x400 0x00000000"
% 

这是一个例外:

Jul 22, 2012 12:17:39 PM com.altera.systemconsole.internal.core.SystemConsole logSevere
SEVERE: com.altera.systemconsole.internal.plugin.jtag.oci.Nios2DebugException: Can't do this while target is running
java.util.concurrent.ExecutionException: com.altera.systemconsole.internal.plugin.jtag.oci.Nios2DebugException: Can't do this while target is running
    at com.altera.systemconsole.internal.core.SimpleFuture$Sync.innerGet(SimpleFuture.java:169)
    at com.altera.systemconsole.internal.core.SimpleFuture.get(SimpleFuture.java:66)
    at com.altera.systemconsole.scripting.StandardCommandSet.waitForFutureResponse(StandardCommandSet.java:233)
    at com.altera.systemconsole.scripting.StandardCommandSet.peekMemoryService(StandardCommandSet.java:161)
    at com.altera.systemconsole.scripting.StandardCommandSet.readByte(StandardCommandSet.java:120)
    at com.altera.systemconsole.scripting.ScriptEngine$16.execute(ScriptEngine.java:1117)
    at com.altera.systemconsole.scripting.ScriptEngine$LegacyCommandAdapter.execute2(ScriptEngine.java:199)
    at com.altera.systemconsole.scripting.SystemConsoleThreadTCLInterpreter$2$1.run(SystemConsoleThreadTCLInterpreter.java:181)
    at com.altera.systemconsole.internal.core.SystemExecutor$4.run(SystemExecutor.java:516)
    at com.altera.systemconsole.internal.core.SystemExecutor$ComparableTask.run(SystemExecutor.java:148)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.altera.systemconsole.internal.plugin.jtag.oci.Nios2DebugException: Can't do this while target is running
    at com.altera.systemconsole.internal.plugin.jtag.oci.Nios2Debug.readMemoryIndirect(Native Method)
    at com.altera.systemconsole.internal.plugin.jtag.oci.Nios2Debug.readMemory(Nios2Debug.java:186)
    at com.altera.systemconsole.internal.plugin.jtag.oci.OciMemoryService.peek(OciMemoryService.java:158)
    at com.altera.systemconsole.internal.core.legacymaster.LegacyMasterChannel$1.run(LegacyMasterChannel.java:88)
    at com.altera.systemconsole.internal.core.SystemExecutor.addTaskIfNecessary(SystemExecutor.java:536)
    at com.altera.systemconsole.internal.core.legacymaster.LegacyMasterChannel.doReadMemory(LegacyMasterChannel.java:77)
    at com.altera.systemconsole.internal.core.legacymaster.LegacyMasterChannel.readMemory(LegacyMasterChannel.java:69)
    at com.altera.systemconsole.scripting.StandardCommandSet.peekMemoryService(StandardCommandSet.java:157)
    ... 9 more

我以前从未使用过 System Console,在 Internet 或手册中找不到任何相关内容。所以问题是——我犯了什么错?任何解决问题的帮助表示赞赏。

4

1 回答 1

3

异常意味着您必须暂停/停止 CPU 才能执行master_write_32。为了保持 CPU 运行,必须使用JTAG 到 Avalon 主桥。它将被导出为另一个服务(即索引为 1),并可用于与 Avalon MM 组件通信。答案的功劳归功于Altera 论坛上的人

于 2012-07-24T20:25:45.163 回答