Forum: FPGA, VHDL & Co. NIOSII Hello World klappt nicht


von Bliad B. (bliad_b)


Angehängte Dateien:

Lesenswert?

Hi,
(Quartus 18.1)
Ich habe folgende Konfiguration im Top-Level-Design.
Cyclone V

Da diese eine Testversion ist steht der NIOS II etwa 1 Stunde zur 
Verfügung. Ich kann das .sof in dieser Zeit auf den FPGA downloaden.
Dann kann ich über "NIOS II Software Build Tools for Eclipse" eigentlich 
den NIOS II programmieren.
Finden kann ich den auch bei den RUN Configurations... aber wenn man das 
Programm laufen lässt, passiert einfach nichts im NIOSII- 
Konsolenfenster :(

1
module toplevel( // hier muss der name vom TopLVL hin
2
// hier werden die signale den realen PINS auf dem Cyclone V zugewiesen, kann man auch im PIN Planner machen, hier bitte darauf achten dass es korrekt ist 
3
  (* chip_pin = "V11" *) input logic clk, 
4
  (* chip_pin = "AH17"  *) input logic reset_n,
5
  (* chip_pin = "AA23, V12, AE26, AF26, V15, V16, AA24, W15" *) output logic [7:0] q
6
  );
7
  
8
  unsaved inst_0 (.clk_clk(clk), // hier wird dann das ganze zeug was im Plattform Designer 
9
  //erstellt wurde isntanziiert. das module fndet man auch in der .qip 
10
  //sammlung. qip bdeuet Quartus IP . die erste datei ist es . in diesem fall "unsaved.v"
11
              .reset_reset_n(reset_n),
12
              .pio_leds_export(q)
13
  );
14
15
  
16
endmodule




1
01:08:04 **** Incremental Build of configuration Nios II for project base_sys_eval22 ****
2
make all 
3
Info: Building ../base_sys_eval22_bsp/
4
C:/intelFPGA_lite/18.1/nios2eds/bin/gnu/H-x86_64-mingw32/bin/make --no-print-directory -C ../base_sys_eval22_bsp/
5
[BSP build complete]
6
[base_sys_eval22 build complete]
7
8
01:08:05 Build Finished (took 769ms)

von Donni D. (Gast)


Lesenswert?

Wieso einen DualPort RAM?
Nutz den freien kleinen NIOS.
Mach ne sysid dabei und mach die Haken bei mismatch id etc raus.

Und mehr Infos dazu wie du alles zusammengebaut hast.

von Bliad B. (bliad_b)


Angehängte Dateien:

Lesenswert?

Dual Port steht in meiner (...) Anleitung. Keine Ahnung was das ist.
Nios f soll außerdem gewählt werden.
>Mach ne sysid dabei
werde ich mir anschauen
>mismatch id etc
hat nix gebracht...

von Bliad B. (bliad_b)


Lesenswert?

1
/*
2
 * system.h - SOPC Builder system and BSP software package information
3
 *
4
 * Machine generated for CPU 'nios2_gen2_0' in SOPC Builder design 'my_sys'
5
 * SOPC Builder design path: ../../my_sys.sopcinfo
6
 *
7
 * Generated: Wed Jul 31 23:19:21 CEST 2019
8
 */
9
10
/*
11
 * DO NOT MODIFY THIS FILE
12
 *
13
 * Changing this file will have subtle consequences
14
 * which will almost certainly lead to a nonfunctioning
15
 * system. If you do modify this file, be aware that your
16
 * changes will be overwritten and lost when this file
17
 * is generated again.
18
 *
19
 * DO NOT MODIFY THIS FILE
20
 */
21
22
/*
23
 * License Agreement
24
 *
25
 * Copyright (c) 2008
26
 * Altera Corporation, San Jose, California, USA.
27
 * All rights reserved.
28
 *
29
 * Permission is hereby granted, free of charge, to any person obtaining a
30
 * copy of this software and associated documentation files (the "Software"),
31
 * to deal in the Software without restriction, including without limitation
32
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
33
 * and/or sell copies of the Software, and to permit persons to whom the
34
 * Software is furnished to do so, subject to the following conditions:
35
 *
36
 * The above copyright notice and this permission notice shall be included in
37
 * all copies or substantial portions of the Software.
38
 *
39
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
41
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
42
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
43
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
44
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
45
 * DEALINGS IN THE SOFTWARE.
46
 *
47
 * This agreement shall be governed in all respects by the laws of the State
48
 * of California and by the laws of the United States of America.
49
 */
50
51
#ifndef __SYSTEM_H_
52
#define __SYSTEM_H_
53
54
/* Include definitions from linker script generator */
55
#include "linker.h"
56
57
58
/*
59
 * CPU configuration
60
 *
61
 */
62
63
#define ALT_CPU_ARCHITECTURE "altera_nios2_gen2"
64
#define ALT_CPU_BIG_ENDIAN 0
65
#define ALT_CPU_BREAK_ADDR 0x00008820
66
#define ALT_CPU_CPU_ARCH_NIOS2_R1
67
#define ALT_CPU_CPU_FREQ 50000000u
68
#define ALT_CPU_CPU_ID_SIZE 1
69
#define ALT_CPU_CPU_ID_VALUE 0x00000000
70
#define ALT_CPU_CPU_IMPLEMENTATION "fast"
71
#define ALT_CPU_DATA_ADDR_WIDTH 0x10
72
#define ALT_CPU_DCACHE_BYPASS_MASK 0x80000000
73
#define ALT_CPU_DCACHE_LINE_SIZE 32
74
#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 5
75
#define ALT_CPU_DCACHE_SIZE 2048
76
#define ALT_CPU_EXCEPTION_ADDR 0x00000020
77
#define ALT_CPU_FLASH_ACCELERATOR_LINES 0
78
#define ALT_CPU_FLASH_ACCELERATOR_LINE_SIZE 0
79
#define ALT_CPU_FLUSHDA_SUPPORTED
80
#define ALT_CPU_FREQ 50000000
81
#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0
82
#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 1
83
#define ALT_CPU_HARDWARE_MULX_PRESENT 0
84
#define ALT_CPU_HAS_DEBUG_CORE 1
85
#define ALT_CPU_HAS_DEBUG_STUB
86
#define ALT_CPU_HAS_EXTRA_EXCEPTION_INFO
87
#define ALT_CPU_HAS_ILLEGAL_INSTRUCTION_EXCEPTION
88
#define ALT_CPU_HAS_JMPI_INSTRUCTION
89
#define ALT_CPU_ICACHE_LINE_SIZE 32
90
#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 5
91
#define ALT_CPU_ICACHE_SIZE 4096
92
#define ALT_CPU_INITDA_SUPPORTED
93
#define ALT_CPU_INST_ADDR_WIDTH 0x10
94
#define ALT_CPU_NAME "nios2_gen2_0"
95
#define ALT_CPU_NUM_OF_SHADOW_REG_SETS 1
96
#define ALT_CPU_OCI_VERSION 1
97
#define ALT_CPU_RESET_ADDR 0x00000000
98
99
100
/*
101
 * CPU configuration (with legacy prefix - don't use these anymore)
102
 *
103
 */
104
105
#define NIOS2_BIG_ENDIAN 0
106
#define NIOS2_BREAK_ADDR 0x00008820
107
#define NIOS2_CPU_ARCH_NIOS2_R1
108
#define NIOS2_CPU_FREQ 50000000u
109
#define NIOS2_CPU_ID_SIZE 1
110
#define NIOS2_CPU_ID_VALUE 0x00000000
111
#define NIOS2_CPU_IMPLEMENTATION "fast"
112
#define NIOS2_DATA_ADDR_WIDTH 0x10
113
#define NIOS2_DCACHE_BYPASS_MASK 0x80000000
114
#define NIOS2_DCACHE_LINE_SIZE 32
115
#define NIOS2_DCACHE_LINE_SIZE_LOG2 5
116
#define NIOS2_DCACHE_SIZE 2048
117
#define NIOS2_EXCEPTION_ADDR 0x00000020
118
#define NIOS2_FLASH_ACCELERATOR_LINES 0
119
#define NIOS2_FLASH_ACCELERATOR_LINE_SIZE 0
120
#define NIOS2_FLUSHDA_SUPPORTED
121
#define NIOS2_HARDWARE_DIVIDE_PRESENT 0
122
#define NIOS2_HARDWARE_MULTIPLY_PRESENT 1
123
#define NIOS2_HARDWARE_MULX_PRESENT 0
124
#define NIOS2_HAS_DEBUG_CORE 1
125
#define NIOS2_HAS_DEBUG_STUB
126
#define NIOS2_HAS_EXTRA_EXCEPTION_INFO
127
#define NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION
128
#define NIOS2_HAS_JMPI_INSTRUCTION
129
#define NIOS2_ICACHE_LINE_SIZE 32
130
#define NIOS2_ICACHE_LINE_SIZE_LOG2 5
131
#define NIOS2_ICACHE_SIZE 4096
132
#define NIOS2_INITDA_SUPPORTED
133
#define NIOS2_INST_ADDR_WIDTH 0x10
134
#define NIOS2_NUM_OF_SHADOW_REG_SETS 1
135
#define NIOS2_OCI_VERSION 1
136
#define NIOS2_RESET_ADDR 0x00000000
137
138
139
/*
140
 * Define for each module class mastered by the CPU
141
 *
142
 */
143
144
#define __ALTERA_AVALON_JTAG_UART
145
#define __ALTERA_AVALON_ONCHIP_MEMORY2
146
#define __ALTERA_AVALON_PIO
147
#define __ALTERA_AVALON_TIMER
148
#define __ALTERA_NIOS2_GEN2
149
150
151
/*
152
 * System configuration
153
 *
154
 */
155
156
#define ALT_DEVICE_FAMILY "Cyclone V"
157
#define ALT_ENHANCED_INTERRUPT_API_PRESENT
158
#define ALT_IRQ_BASE NULL
159
#define ALT_LOG_PORT "/dev/null"
160
#define ALT_LOG_PORT_BASE 0x0
161
#define ALT_LOG_PORT_DEV null
162
#define ALT_LOG_PORT_TYPE ""
163
#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0
164
#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1
165
#define ALT_NUM_INTERRUPT_CONTROLLERS 1
166
#define ALT_STDERR "/dev/jtag_uart_0"
167
#define ALT_STDERR_BASE 0x9030
168
#define ALT_STDERR_DEV jtag_uart_0
169
#define ALT_STDERR_IS_JTAG_UART
170
#define ALT_STDERR_PRESENT
171
#define ALT_STDERR_TYPE "altera_avalon_jtag_uart"
172
#define ALT_STDIN "/dev/jtag_uart_0"
173
#define ALT_STDIN_BASE 0x9030
174
#define ALT_STDIN_DEV jtag_uart_0
175
#define ALT_STDIN_IS_JTAG_UART
176
#define ALT_STDIN_PRESENT
177
#define ALT_STDIN_TYPE "altera_avalon_jtag_uart"
178
#define ALT_STDOUT "/dev/jtag_uart_0"
179
#define ALT_STDOUT_BASE 0x9030
180
#define ALT_STDOUT_DEV jtag_uart_0
181
#define ALT_STDOUT_IS_JTAG_UART
182
#define ALT_STDOUT_PRESENT
183
#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart"
184
#define ALT_SYSTEM_NAME "my_sys"
185
186
187
/*
188
 * hal configuration
189
 *
190
 */
191
192
#define ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
193
#define ALT_MAX_FD 4
194
#define ALT_SYS_CLK none
195
#define ALT_TIMESTAMP_CLK none
196
197
198
/*
199
 * jtag_uart_0 configuration
200
 *
201
 */
202
203
#define ALT_MODULE_CLASS_jtag_uart_0 altera_avalon_jtag_uart
204
#define JTAG_UART_0_BASE 0x9030
205
#define JTAG_UART_0_IRQ 1
206
#define JTAG_UART_0_IRQ_INTERRUPT_CONTROLLER_ID 0
207
#define JTAG_UART_0_NAME "/dev/jtag_uart_0"
208
#define JTAG_UART_0_READ_DEPTH 64
209
#define JTAG_UART_0_READ_THRESHOLD 8
210
#define JTAG_UART_0_SPAN 8
211
#define JTAG_UART_0_TYPE "altera_avalon_jtag_uart"
212
#define JTAG_UART_0_WRITE_DEPTH 64
213
#define JTAG_UART_0_WRITE_THRESHOLD 8
214
215
216
/*
217
 * onchip_memory2_0 configuration
218
 *
219
 */
220
221
#define ALT_MODULE_CLASS_onchip_memory2_0 altera_avalon_onchip_memory2
222
#define ONCHIP_MEMORY2_0_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0
223
#define ONCHIP_MEMORY2_0_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0
224
#define ONCHIP_MEMORY2_0_BASE 0x0
225
#define ONCHIP_MEMORY2_0_CONTENTS_INFO ""
226
#define ONCHIP_MEMORY2_0_DUAL_PORT 1
227
#define ONCHIP_MEMORY2_0_GUI_RAM_BLOCK_TYPE "AUTO"
228
#define ONCHIP_MEMORY2_0_INIT_CONTENTS_FILE "my_sys_onchip_memory2_0"
229
#define ONCHIP_MEMORY2_0_INIT_MEM_CONTENT 1
230
#define ONCHIP_MEMORY2_0_INSTANCE_ID "NONE"
231
#define ONCHIP_MEMORY2_0_IRQ -1
232
#define ONCHIP_MEMORY2_0_IRQ_INTERRUPT_CONTROLLER_ID -1
233
#define ONCHIP_MEMORY2_0_NAME "/dev/onchip_memory2_0"
234
#define ONCHIP_MEMORY2_0_NON_DEFAULT_INIT_FILE_ENABLED 0
235
#define ONCHIP_MEMORY2_0_RAM_BLOCK_TYPE "AUTO"
236
#define ONCHIP_MEMORY2_0_READ_DURING_WRITE_MODE "DONT_CARE"
237
#define ONCHIP_MEMORY2_0_SINGLE_CLOCK_OP 0
238
#define ONCHIP_MEMORY2_0_SIZE_MULTIPLE 1
239
#define ONCHIP_MEMORY2_0_SIZE_VALUE 30000
240
#define ONCHIP_MEMORY2_0_SPAN 30000
241
#define ONCHIP_MEMORY2_0_TYPE "altera_avalon_onchip_memory2"
242
#define ONCHIP_MEMORY2_0_WRITABLE 1
243
244
245
/*
246
 * pio_0 configuration
247
 *
248
 */
249
250
#define ALT_MODULE_CLASS_pio_0 altera_avalon_pio
251
#define PIO_0_BASE 0x9020
252
#define PIO_0_BIT_CLEARING_EDGE_REGISTER 0
253
#define PIO_0_BIT_MODIFYING_OUTPUT_REGISTER 0
254
#define PIO_0_CAPTURE 0
255
#define PIO_0_DATA_WIDTH 8
256
#define PIO_0_DO_TEST_BENCH_WIRING 0
257
#define PIO_0_DRIVEN_SIM_VALUE 0
258
#define PIO_0_EDGE_TYPE "NONE"
259
#define PIO_0_FREQ 50000000
260
#define PIO_0_HAS_IN 0
261
#define PIO_0_HAS_OUT 1
262
#define PIO_0_HAS_TRI 0
263
#define PIO_0_IRQ -1
264
#define PIO_0_IRQ_INTERRUPT_CONTROLLER_ID -1
265
#define PIO_0_IRQ_TYPE "NONE"
266
#define PIO_0_NAME "/dev/pio_0"
267
#define PIO_0_RESET_VALUE 0
268
#define PIO_0_SPAN 16
269
#define PIO_0_TYPE "altera_avalon_pio"
270
271
272
/*
273
 * timer_0 configuration
274
 *
275
 */
276
277
#define ALT_MODULE_CLASS_timer_0 altera_avalon_timer
278
#define TIMER_0_ALWAYS_RUN 0
279
#define TIMER_0_BASE 0x9000
280
#define TIMER_0_COUNTER_SIZE 32
281
#define TIMER_0_FIXED_PERIOD 0
282
#define TIMER_0_FREQ 50000000
283
#define TIMER_0_IRQ 0
284
#define TIMER_0_IRQ_INTERRUPT_CONTROLLER_ID 0
285
#define TIMER_0_LOAD_VALUE 49999
286
#define TIMER_0_MULT 0.001
287
#define TIMER_0_NAME "/dev/timer_0"
288
#define TIMER_0_PERIOD 1
289
#define TIMER_0_PERIOD_UNITS "ms"
290
#define TIMER_0_RESET_OUTPUT 0
291
#define TIMER_0_SNAPSHOT 1
292
#define TIMER_0_SPAN 32
293
#define TIMER_0_TICKS_PER_SEC 1000
294
#define TIMER_0_TIMEOUT_PULSE_OUTPUT 0
295
#define TIMER_0_TYPE "altera_avalon_timer"
296
297
#endif /* __SYSTEM_H_ */

von Bliad B. (bliad_b)


Lesenswert?

kann doch nicht so schwer sein xD

von Bliad B. (bliad_b)


Lesenswert?

Das steht in der Eclipse Console:
1
Using cable "DE-SoC [USB-1]", device 2, instance 0x00
2
Processor is already paused
3
Initializing CPU cache (if present)
4
OK
5
6
Downloading 00000000 ( 0%)
7
Downloading 000004D0 (99%)
8
Downloaded 2KB in 0.0s        
9
10
Verifying 00000000 ( 0%)
11
Verifying 000004D0 (99%)
12
Verified OK                         
13
Starting processor at address 0x00000020

: Bearbeitet durch User
von Markus F. (mfro)


Lesenswert?

Bliad B. schrieb:
> #define JTAG_UART_0_BASE 0x9030

in deinem system.h steht 0x9030 als JTAG uart-Basisadresse, in deinen 
Screenshots 0x9040. Das kann m.E. so nicht funktionieren.

Wenn auf der nios console was erscheinen soll, muss das zusammenpassen.

von Bliad B. (bliad_b)


Angehängte Dateien:

Lesenswert?

Habe jetzt mal die Adressen geändert in der System.h aber das 
funktioniert noch nicht

/*
 * system.h - SOPC Builder system and BSP software package information
 *
 * Machine generated for CPU 'nios2_gen2_0' in SOPC Builder design 
'my_sys'
 * SOPC Builder design path: ../../my_sys.sopcinfo
 *
 * Generated: Thu Aug 01 17:30:02 CEST 2019
 */

/*
 * DO NOT MODIFY THIS FILE
 *
 * Changing this file will have subtle consequences
 * which will almost certainly lead to a nonfunctioning
 * system. If you do modify this file, be aware that your
 * changes will be overwritten and lost when this file
 * is generated again.
 *
 * DO NOT MODIFY THIS FILE
 */

/*
 * License Agreement
 *
 * Copyright (c) 2008
 * Altera Corporation, San Jose, California, USA.
 * All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining 
a
 * copy of this software and associated documentation files (the 
"Software"),
 * to deal in the Software without restriction, including without 
limitation
 * the rights to use, copy, modify, merge, publish, distribute, 
sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be 
included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 
SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 *
 * This agreement shall be governed in all respects by the laws of the 
State
 * of California and by the laws of the United States of America.
 */

#ifndef _SYSTEM_H
#define _SYSTEM_H

/* Include definitions from linker script generator */
#include "linker.h"


/*
 * CPU configuration
 *
 */

#define ALT_CPU_ARCHITECTURE "altera_nios2_gen2"
#define ALT_CPU_BIG_ENDIAN 0
#define ALT_CPU_BREAK_ADDR 0x00008820
#define ALT_CPU_CPU_ARCH_NIOS2_R1
#define ALT_CPU_CPU_FREQ 50000000u
#define ALT_CPU_CPU_ID_SIZE 1
#define ALT_CPU_CPU_ID_VALUE 0x00000000
#define ALT_CPU_CPU_IMPLEMENTATION "fast"
#define ALT_CPU_DATA_ADDR_WIDTH 0x10
#define ALT_CPU_DCACHE_BYPASS_MASK 0x80000000
#define ALT_CPU_DCACHE_LINE_SIZE 32
#define ALT_CPU_DCACHE_LINE_SIZE_LOG2 5
#define ALT_CPU_DCACHE_SIZE 2048
#define ALT_CPU_EXCEPTION_ADDR 0x00000020
#define ALT_CPU_FLASH_ACCELERATOR_LINES 0
#define ALT_CPU_FLASH_ACCELERATOR_LINE_SIZE 0
#define ALT_CPU_FLUSHDA_SUPPORTED
#define ALT_CPU_FREQ 50000000
#define ALT_CPU_HARDWARE_DIVIDE_PRESENT 0
#define ALT_CPU_HARDWARE_MULTIPLY_PRESENT 1
#define ALT_CPU_HARDWARE_MULX_PRESENT 0
#define ALT_CPU_HAS_DEBUG_CORE 1
#define ALT_CPU_HAS_DEBUG_STUB
#define ALT_CPU_HAS_EXTRA_EXCEPTION_INFO
#define ALT_CPU_HAS_ILLEGAL_INSTRUCTION_EXCEPTION
#define ALT_CPU_HAS_JMPI_INSTRUCTION
#define ALT_CPU_ICACHE_LINE_SIZE 32
#define ALT_CPU_ICACHE_LINE_SIZE_LOG2 5
#define ALT_CPU_ICACHE_SIZE 4096
#define ALT_CPU_INITDA_SUPPORTED
#define ALT_CPU_INST_ADDR_WIDTH 0x10
#define ALT_CPU_NAME "nios2_gen2_0"
#define ALT_CPU_NUM_OF_SHADOW_REG_SETS 1
#define ALT_CPU_OCI_VERSION 1
#define ALT_CPU_RESET_ADDR 0x00000000


/*
 * CPU configuration (with legacy prefix - don't use these anymore)
 *
 */

#define NIOS2_BIG_ENDIAN 0
#define NIOS2_BREAK_ADDR 0x00008820
#define NIOS2_CPU_ARCH_NIOS2_R1
#define NIOS2_CPU_FREQ 50000000u
#define NIOS2_CPU_ID_SIZE 1
#define NIOS2_CPU_ID_VALUE 0x00000000
#define NIOS2_CPU_IMPLEMENTATION "fast"
#define NIOS2_DATA_ADDR_WIDTH 0x10
#define NIOS2_DCACHE_BYPASS_MASK 0x80000000
#define NIOS2_DCACHE_LINE_SIZE 32
#define NIOS2_DCACHE_LINE_SIZE_LOG2 5
#define NIOS2_DCACHE_SIZE 2048
#define NIOS2_EXCEPTION_ADDR 0x00000020
#define NIOS2_FLASH_ACCELERATOR_LINES 0
#define NIOS2_FLASH_ACCELERATOR_LINE_SIZE 0
#define NIOS2_FLUSHDA_SUPPORTED
#define NIOS2_HARDWARE_DIVIDE_PRESENT 0
#define NIOS2_HARDWARE_MULTIPLY_PRESENT 1
#define NIOS2_HARDWARE_MULX_PRESENT 0
#define NIOS2_HAS_DEBUG_CORE 1
#define NIOS2_HAS_DEBUG_STUB
#define NIOS2_HAS_EXTRA_EXCEPTION_INFO
#define NIOS2_HAS_ILLEGAL_INSTRUCTION_EXCEPTION
#define NIOS2_HAS_JMPI_INSTRUCTION
#define NIOS2_ICACHE_LINE_SIZE 32
#define NIOS2_ICACHE_LINE_SIZE_LOG2 5
#define NIOS2_ICACHE_SIZE 4096
#define NIOS2_INITDA_SUPPORTED
#define NIOS2_INST_ADDR_WIDTH 0x10
#define NIOS2_NUM_OF_SHADOW_REG_SETS 1
#define NIOS2_OCI_VERSION 1
#define NIOS2_RESET_ADDR 0x00000000


/*
 * Define for each module class mastered by the CPU
 *
 */

#define __ALTERA_AVALON_JTAG_UART
#define __ALTERA_AVALON_ONCHIP_MEMORY2
#define __ALTERA_AVALON_PIO
#define __ALTERA_AVALON_TIMER
#define __ALTERA_NIOS2_GEN2


/*
 * System configuration
 *
 */

#define ALT_DEVICE_FAMILY "Cyclone V"
#define ALT_ENHANCED_INTERRUPT_API_PRESENT
#define ALT_IRQ_BASE NULL
#define ALT_LOG_PORT "/dev/null"
#define ALT_LOG_PORT_BASE 0x0
#define ALT_LOG_PORT_DEV null
#define ALT_LOG_PORT_TYPE ""
#define ALT_NUM_EXTERNAL_INTERRUPT_CONTROLLERS 0
#define ALT_NUM_INTERNAL_INTERRUPT_CONTROLLERS 1
#define ALT_NUM_INTERRUPT_CONTROLLERS 1
#define ALT_STDERR "/dev/jtag_uart_0"
#define ALT_STDERR_BASE 0x9040
#define ALT_STDERR_DEV jtag_uart_0
#define ALT_STDERR_IS_JTAG_UART
#define ALT_STDERR_PRESENT
#define ALT_STDERR_TYPE "altera_avalon_jtag_uart"
#define ALT_STDIN "/dev/jtag_uart_0"
#define ALT_STDIN_BASE 0x9040
#define ALT_STDIN_DEV jtag_uart_0
#define ALT_STDIN_IS_JTAG_UART
#define ALT_STDIN_PRESENT
#define ALT_STDIN_TYPE "altera_avalon_jtag_uart"
#define ALT_STDOUT "/dev/jtag_uart_0"
#define ALT_STDOUT_BASE 0x9040
#define ALT_STDOUT_DEV jtag_uart_0
#define ALT_STDOUT_IS_JTAG_UART
#define ALT_STDOUT_PRESENT
#define ALT_STDOUT_TYPE "altera_avalon_jtag_uart"
#define ALT_SYSTEM_NAME "my_sys"


/*
 * hal configuration
 *
 */

#define ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API
#define ALT_MAX_FD 4
#define ALT_SYS_CLK none
#define ALT_TIMESTAMP_CLK none


/*
 * jtag_uart_0 configuration
 *
 */

#define ALT_MODULE_CLASS_jtag_uart_0 altera_avalon_jtag_uart
#define JTAG_UART_0_BASE 0x9040
#define JTAG_UART_0_IRQ 1
#define JTAG_UART_0_IRQ_INTERRUPT_CONTROLLER_ID 0
#define JTAG_UART_0_NAME "/dev/jtag_uart_0"
#define JTAG_UART_0_READ_DEPTH 64
#define JTAG_UART_0_READ_THRESHOLD 8
#define JTAG_UART_0_SPAN 8
#define JTAG_UART_0_TYPE "altera_avalon_jtag_uart"
#define JTAG_UART_0_WRITE_DEPTH 64
#define JTAG_UART_0_WRITE_THRESHOLD 8


/*
 * onchip_memory2_0 configuration
 *
 */

#define ALT_MODULE_CLASS_onchip_memory2_0 altera_avalon_onchip_memory2
#define ONCHIP_MEMORY2_0_ALLOW_IN_SYSTEM_MEMORY_CONTENT_EDITOR 0
#define ONCHIP_MEMORY2_0_ALLOW_MRAM_SIM_CONTENTS_ONLY_FILE 0
#define ONCHIP_MEMORY2_0_BASE 0x0
#define ONCHIP_MEMORY2_0_CONTENTS_INFO ""
#define ONCHIP_MEMORY2_0_DUAL_PORT 1
#define ONCHIP_MEMORY2_0_GUI_RAM_BLOCK_TYPE "AUTO"
#define ONCHIP_MEMORY2_0_INIT_CONTENTS_FILE "my_sys_onchip_memory2_0"
#define ONCHIP_MEMORY2_0_INIT_MEM_CONTENT 1
#define ONCHIP_MEMORY2_0_INSTANCE_ID "NONE"
#define ONCHIP_MEMORY2_0_IRQ -1
#define ONCHIP_MEMORY2_0_IRQ_INTERRUPT_CONTROLLER_ID -1
#define ONCHIP_MEMORY2_0_NAME "/dev/onchip_memory2_0"
#define ONCHIP_MEMORY2_0_NON_DEFAULT_INIT_FILE_ENABLED 0
#define ONCHIP_MEMORY2_0_RAM_BLOCK_TYPE "AUTO"
#define ONCHIP_MEMORY2_0_READ_DURING_WRITE_MODE "DONT_CARE"
#define ONCHIP_MEMORY2_0_SINGLE_CLOCK_OP 0
#define ONCHIP_MEMORY2_0_SIZE_MULTIPLE 1
#define ONCHIP_MEMORY2_0_SIZE_VALUE 30000
#define ONCHIP_MEMORY2_0_SPAN 30000
#define ONCHIP_MEMORY2_0_TYPE "altera_avalon_onchip_memory2"
#define ONCHIP_MEMORY2_0_WRITABLE 1


/*
 * pio_0 configuration
 *
 */

#define ALT_MODULE_CLASS_pio_0 altera_avalon_pio
#define PIO_0_BASE 0x9020
#define PIO_0_BIT_CLEARING_EDGE_REGISTER 0
#define PIO_0_BIT_MODIFYING_OUTPUT_REGISTER 0
#define PIO_0_CAPTURE 0
#define PIO_0_DATA_WIDTH 8
#define PIO_0_DO_TEST_BENCH_WIRING 0
#define PIO_0_DRIVEN_SIM_VALUE 0
#define PIO_0_EDGE_TYPE "NONE"
#define PIO_0_FREQ 50000000
#define PIO_0_HAS_IN 0
#define PIO_0_HAS_OUT 1
#define PIO_0_HAS_TRI 0
#define PIO_0_IRQ -1
#define PIO_0_IRQ_INTERRUPT_CONTROLLER_ID -1
#define PIO_0_IRQ_TYPE "NONE"
#define PIO_0_NAME "/dev/pio_0"
#define PIO_0_RESET_VALUE 0
#define PIO_0_SPAN 16
#define PIO_0_TYPE "altera_avalon_pio"


/*
 * timer_0 configuration
 *
 */

#define ALT_MODULE_CLASS_timer_0 altera_avalon_timer
#define TIMER_0_ALWAYS_RUN 0
#define TIMER_0_BASE 0x9000
#define TIMER_0_COUNTER_SIZE 32
#define TIMER_0_FIXED_PERIOD 0
#define TIMER_0_FREQ 50000000
#define TIMER_0_IRQ 0
#define TIMER_0_IRQ_INTERRUPT_CONTROLLER_ID 0
#define TIMER_0_LOAD_VALUE 49999
#define TIMER_0_MULT 0.001
#define TIMER_0_NAME "/dev/timer_0"
#define TIMER_0_PERIOD 1
#define TIMER_0_PERIOD_UNITS "ms"
#define TIMER_0_RESET_OUTPUT 0
#define TIMER_0_SNAPSHOT 1
#define TIMER_0_SPAN 32
#define TIMER_0_TICKS_PER_SEC 1000
#define TIMER_0_TIMEOUT_PULSE_OUTPUT 0
#define TIMER_0_TYPE "altera_avalon_timer"

#endif /* _SYSTEM_H */

von Bliad B. (bliad_b)


Lesenswert?

#define ALT_STDERR_BASE 0x9040
was bedeutet eigentlich diese "ALT"... alternativ oder was xD

von Bliad B. (bliad_b)


Lesenswert?

Bin auch die ganze Zeit am schauen ob es ein passendes Tutorial gibt. 
Naja ...

von ... (Gast)


Lesenswert?

ALT wie Altera!

von Samuel C. (neoexacun)


Lesenswert?

Bliad B. schrieb:
> #define ALT_STDERR_BASE 0x9040
> was bedeutet eigentlich diese "ALT"... alternativ oder was xD

Ich würde mal auf "Altera" tippen.

von Markus F. (mfro)


Lesenswert?

Bliad B. schrieb:
> Habe jetzt mal die Adressen geändert in der System.h aber das
> funktioniert noch nicht

Du hast die Datei manuell geändert?

Bliad B. schrieb:
> /*
>  * DO NOT MODIFY THIS FILE
>  *
>  * Changing this file will have subtle consequences
>  * which will almost certainly lead to a nonfunctioning
>  * system. If you do modify this file, be aware that your
>  * changes will be overwritten and lost when this file
>  * is generated again.
>  *
>  * DO NOT MODIFY THIS FILE
>  */

Warum glaubst Du, haben die das da hingeschrieben?

von Bliad B. (bliad_b)


Lesenswert?

Markus F. schrieb:
> Bliad B. schrieb:
>> Habe jetzt mal die Adressen geändert in der System.h aber das
>> funktioniert noch nicht
>
> Du hast die Datei manuell geändert?
>
> Bliad B. schrieb:
>> /*
>>  * DO NOT MODIFY THIS FILE
>>  *
>>  * Changing this file will have subtle consequences
>>  * which will almost certainly lead to a nonfunctioning
>>  * system. If you do modify this file, be aware that your
>>  * changes will be overwritten and lost when this file
>>  * is generated again.
>>  *
>>  * DO NOT MODIFY THIS FILE
>>  */
>
> Warum glaubst Du, haben die das da hingeschrieben?

Damit Laien nichts ändern xD
Naja ich dachte entweder ich änder die angesprochene Adresse in System.h 
oder beim plattform desginer. ich dachte die system.h hat immer den 
gleichen inhalt und brauch etwas veränderung.

Also müsste ich die Adresse wohl im Plattform Designer ändern ?...

: Bearbeitet durch User
von Bliad B. (bliad_b)


Lesenswert?

https://docdro.id/sZ8LneP

Nochmal eine kleine Zusammenfassung ( hochgeladenes PDF)

von Fieldengineer (Gast)


Lesenswert?

The six easy steps to NIOSII:

1. QSYS - Edit System Contents
2. QSYS - Generate Design
3. Quartus2 - Full Compilation
4. Quartus2 Programmer - Write SOF-file to device
5. NiosII BSP Editor - Generate BSP
6. NiosII Compile all and Launch

Its that easy.

von Bliad B. (bliad_b)


Lesenswert?

Yes, but i was trying it with Quartus 18.1

But i think i will also try it with your proposed toolchain . I read of 
it already, but wanted to do it with Q18.1 ...
:D

von Bliad B. (bliad_b)


Lesenswert?

Hello from Nios II!


It worked man!!!

The fault was the sopcinfo file direction, it was wrong :,)

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.