Skip to content

Commit 640f151

Browse files
committed
Readme update
1 parent fe7b8bb commit 640f151

File tree

6 files changed

+292
-309
lines changed

6 files changed

+292
-309
lines changed

niosv_c/niosv_c_helloworld_ocm_mem_test/sources/README.md

Lines changed: 44 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,78 +16,72 @@
1616

1717
The directory structure is explained below:
1818

19-
> hw- necessary hardware files (.qpf, .qsf, .sv, .v, .ip) of the design
19+
- hw - necessary hardware files (.qpf, .qsf, .sv, .v, .ip) of the design
2020

21-
> sw- This folder contains software application files
21+
- sw - This folder contains software application files
2222

23-
> scripts- This folder consists of scripts to build the design
23+
- scripts - This folder consists of scripts to build the design
2424

2525

2626
### 2. Using existing files to run the design on hardware
2727

28-
> The sof and elf files required to run the design can be found in "ready_to_test" folder
28+
- The sof and elf files required to run the design can be found in "ready_to_test" folder
2929

30-
> Refer the Hardware validation section (3.d) for the steps
30+
- Refer the Hardware validation section (3.d) for the steps
3131

3232
### 3. Building the design from scratch
3333

3434
The steps to build the project from scratch are mentioned below:
3535

3636
a. Required directory structure
37-
- The top-level project folder should have directory structure as mentioned in Section 1 (Directory Structure).
37+
- The top-level project folder should have directory structure as mentioned in Section 1 (Directory Structure).
3838

3939
b. Using build_sof.py to compile the design
40-
- Invoke the quartus_py shell in the terminal
41-
- Run the following command in the terminal from top level project directory:
42-
43-
> quartus_py ./scripts/build_sof.py
40+
- Invoke the quartus_py shell in the terminal
4441

45-
- The quartus tool will compile the design and generate the output files
42+
- Run the following command in the terminal from top level project directory:
43+
```
44+
quartus_py ./scripts/build_sof.py
45+
```
46+
- The quartus tool will compile the design and generate the output files
4647

4748
c. Creating the bsp, build software sources and download elf
48-
- To create software app, run the following commands in the terminal:
49-
50-
> clean the app build project before regenerating elf
51-
52-
> niosv-bsp -c --quartus-project=hw/top.qpf --qsys=hw/qsys_top.qsys --type=hal --script=sw/bsp-update-small-driver.tcl sw/bsp/settings.bsp
53-
54-
> niosv-app --bsp-dir=sw/bsp --app-dir=sw/app --srcs=sw/app/main.c
55-
56-
> niosv-shell
57-
58-
> cmake -S ./sw/app -B sw/app/build -G "Unix Makefiles"
59-
60-
> make -C sw/app/build
49+
- To create software app, run the following commands in the terminal:
6150

62-
> elf2hex sw/app/build/app.elf -b 0x0 -w 32 -e 0x9ffff sw/app/build/onchip_mem.hex -r4
63-
64-
Note: Reduce the JTAG clock frequency to 6MHz before programming the application .elf file on the board.
65-
command: jtagconfig --setparam 1 JtagClock 6M
66-
51+
- Clean the app build project before regenerating elf
52+
```
53+
niosv-bsp -c --quartus-project=hw/top.qpf --qsys=hw/qsys_top.qsys --type=hal --script=sw/bsp-update-small-driver.tcl sw/bsp/settings.bsp
54+
niosv-app --bsp-dir=sw/bsp --app-dir=sw/app --srcs=sw/app/main.c
55+
niosv-shell
56+
cmake -S ./sw/app -B sw/app/build -G "Unix Makefiles"
57+
make -C sw/app/build
58+
elf2hex sw/app/build/app.elf -b 0x0 -w 32 -e 0x9ffff sw/app/build/onchip_mem.hex -r4
59+
```
6760

6861
d. Hardware Validation
69-
- Program the generated sof file on the board
70-
71-
> quartus_pgm --cable=1 -m jtag -o 'p;ready_to_test/top.sof'
72-
73-
- Verify the output on the terminal by using the following command in the terminal:
74-
75-
> juart-terminal -d 1 -c 1 -i 0
62+
- Program the generated sof file on the board
63+
```
64+
quartus_pgm --cable=1 -m jtag -o 'p;ready_to_test/top.sof'
65+
```
66+
- Reduce the JTAG clock frequency to 6MHz before programming the application .elf file on the board.
67+
```
68+
jtagconfig --setparam 1 JtagClock 6M
69+
```
70+
- Verify the output on the terminal by using the following command in the terminal:
71+
```
72+
juart-terminal -d 1 -c 1 -i 0
73+
```
7674

7775
### 4. Running simulation
7876

7977
Simulation is enabled for this design where the memory is initialized with the application hex. Use the following commands to run the simulation:
80-
81-
> Generate Testbench from Platform Designer. Generate -> Generate Testbench System
82-
83-
> cp ./sw/app/build/onchip_mem.hex ./*_tb/*_tb/sim/mentor
84-
85-
> cd hw/*_tb/*_tb/sim/mentor/
86-
87-
> vsim &
88-
89-
> source msim_setup.tcl
90-
91-
> ld_debug
92-
93-
> run -all
78+
79+
- Generate Testbench from Platform Designer. Generate -> Generate Testbench System
80+
```
81+
cp ./sw/app/build/onchip_mem.hex ./qsys_top_tb/qsys_top_tb/sim/mentor
82+
cd hw/qsys_top_tb/qsys_top_tb/sim/mentor/
83+
vsim &
84+
source msim_setup.tcl
85+
ld_debug
86+
run -all
87+
```

niosv_g/niosv_g_helloworld/sources/README.md

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,78 +16,76 @@
1616

1717
The directory structure is explained below:
1818

19-
> hw- necessary hardware files (.qpf, .qsf, .sv, .v, .ip) of the design
19+
- hw - necessary hardware files (.qpf, .qsf, .sv, .v, .ip) of the design
2020

21-
> sw- This folder contains software application files
21+
- sw - This folder contains software application files
2222

23-
> scripts- This folder consists of scripts to build the design
23+
- scripts - This folder consists of scripts to build the design
2424

2525
### 2. Using existing files to run the design on hardware
2626

27-
> The sof and elf files required to run the design can be found in "ready_to_test" folder
27+
- The sof and elf files required to run the design can be found in "ready_to_test" folder
2828

29-
> Refer the Hardware validation section (3.d) for the steps
29+
- Refer the Hardware validation section (3.d) for the steps
3030

3131
### 3. Building the design from scratch
3232

3333
The steps to build the project from scratch are mentioned below:
3434

3535
a. Required directory structure
36-
- The top-level project folder should have directory structure as mentioned in Section 1 (Directory Structure).
36+
- The top-level project folder should have directory structure as mentioned in Section 1 (Directory Structure).
3737

3838
b. Using build_sof.py to compile the design
39-
- Invoke the quartus_py shell in the terminal
40-
- Run the following command in the terminal from top level project directory:
41-
> quartus_py ./scripts/build_sof.py
42-
- The quartus tool will compile the design and generate the output files
39+
- Invoke the quartus_py shell in the terminal
40+
41+
- Run the following command in the terminal from top level project directory:
42+
quartus_py ./scripts/build_sof.py
43+
44+
- The quartus tool will compile the design and generate the output files
4345

4446
c. Creating the bsp, build software sources and download elf
45-
- To create software app, run the following commands in the terminal:
46-
Note: clean the app build project before regenerating elf
47-
48-
> niosv-bsp -c --quartus-project=hw/top.qpf --qsys=hw/qsys_top.qsys --type=hal sw/bsp/settings.bsp
49-
50-
> niosv-app --bsp-dir=sw/bsp --app-dir=sw/app --srcs=sw/app/main.c
51-
52-
> niosv-shell
53-
54-
> cmake -S ./sw/app -B sw/app/build -G "Unix Makefiles"
55-
56-
> make -C sw/app/build
57-
58-
> elf2hex sw/app/build/app.elf -b 0x0 -w 32 -e 0x9ffff sw/app/build/onchip_mem.hex -r4
59-
60-
61-
Note: Reduce the JTAG clock frequency to 6MHz before programming the application .elf file on the board.
62-
command: jtagconfig --setparam 1 JtagClock 6M
47+
- To create software app, run the following commands in the terminal:
48+
49+
- Clean the app build project before regenerating elf
50+
```
51+
niosv-bsp -c --quartus-project=hw/top.qpf --qsys=hw/qsys_top.qsys --type=hal sw/bsp/settings.bsp
52+
niosv-app --bsp-dir=sw/bsp --app-dir=sw/app --srcs=sw/app/main.c
53+
niosv-shell
54+
cmake -S ./sw/app -B sw/app/build -G "Unix Makefiles"
55+
make -C sw/app/build
56+
elf2hex sw/app/build/app.elf -b 0x0 -w 32 -e 0x9ffff sw/app/build/onchip_mem.hex -r4
57+
```
58+
6359

6460
d. Hardware Validation
65-
- Program the generated sof and then download the elf file on the board
66-
67-
> quartus_pgm --cable=1 -m jtag -o 'p;ready_to_test/top.sof'
68-
69-
- Download the elf file on the board
70-
71-
> niosv-download -g ready_to_test/app.elf -c 1
72-
73-
- Verify the output on the terminal by using the following command in the terminal:
74-
75-
> juart-terminal -d 1 -c 1 -i 0
61+
- Program the generated sof and then download the elf file on the board
62+
```
63+
quartus_pgm --cable=1 -m jtag -o 'p;ready_to_test/top.sof'
64+
```
65+
- Reduce the JTAG clock frequency to 6MHz before programming the application .elf file on the board.
66+
```
67+
jtagconfig --setparam 1 JtagClock 6M
68+
```
69+
- Download the elf file on the board
70+
```
71+
niosv-download -g ready_to_test/app.elf -c 1
72+
```
73+
- Verify the output on the terminal by using the following command in the terminal:
74+
```
75+
juart-terminal -d 1 -c 1 -i 0
76+
```
7677

7778
### 4. Running simulation
7879

7980
Simulation is enabled for this design where the memory is initialized with the application hex. Use the following commands to run the simulation:
80-
81-
> Generate Testbench from Platform Designer. Generate -> Generate Testbench System
82-
83-
> cp ./sw/app/build/onchip_mem.hex ./*_tb/*_tb/sim/mentor
84-
85-
> cd hw/*_tb/*_tb/sim/mentor/
86-
87-
> vsim &
88-
89-
> source msim_setup.tcl
90-
91-
> ld_debug
92-
93-
> run -all
81+
82+
- Generate Testbench from Platform Designer. Generate -> Generate Testbench System
83+
84+
```
85+
cp ./sw/app/build/onchip_mem.hex ./qsys_top_tb/qsys_top_tb/sim/mentor
86+
cd hw/qsys_top_tb/qsys_top_tb/sim/mentor/
87+
vsim &
88+
source msim_setup.tcl
89+
ld_debug
90+
run -all
91+
```

niosv_g/niosv_g_ocm_mem_test/sources/README.md

Lines changed: 49 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -16,80 +16,76 @@
1616

1717
The directory structure is explained below:
1818

19-
> hw- necessary hardware files (.qpf, .qsf, .sv, .v, .ip) of the design
19+
- hw- necessary hardware files (.qpf, .qsf, .sv, .v, .ip) of the design
2020

21-
> sw- This folder contains software application files
21+
- sw- This folder contains software application files
2222

23-
> scripts- This folder consists of scripts to build the design
23+
- scripts- This folder consists of scripts to build the design
2424

2525
### 2. Using existing files to run the design on hardware
2626

27-
> The sof and elf files required to run the design can be found in "ready_to_test" folder
27+
- The sof and elf files required to run the design can be found in "ready_to_test" folder
2828

29-
> Refer the Hardware validation section (3.d) for the steps
29+
- Refer the Hardware validation section (3.d) for the steps
3030

3131

3232
### 3. Building the design from scratch
3333

3434
The steps to build the project from scratch are mentioned below:
3535

3636
a. Required directory structure
37-
- The top-level project folder should have directory structure as mentioned in Section 1 (Directory Structure).
37+
- The top-level project folder should have directory structure as mentioned in Section 1 (Directory Structure).
3838

3939
b. Using build_sof.py to compile the design
40-
- Invoke the quartus_py shell in the terminal
41-
- Run the following command in the terminal from top level project directory:
42-
43-
> quartus_py ./scripts/build_sof.py
44-
45-
- The quartus tool will compile the design and generate the output files
40+
- Invoke the quartus_py shell in the terminal
41+
42+
- Run the following command in the terminal from top level project directory:
43+
```
44+
quartus_py ./scripts/build_sof.py
45+
```
46+
- The quartus tool will compile the design and generate the output files
4647

4748
c. Creating the bsp, build software sources and download elf
48-
- To create software app, run the following commands in the terminal:
49-
Note:clean the app build project before regenerating elf
50-
51-
> niosv-bsp -c --quartus-project=hw/top.qpf --qsys=hw/qsys_top.qsys --type=hal sw/bsp/settings.bsp
52-
53-
> niosv-app --bsp-dir=sw/bsp --app-dir=sw/app --srcs=sw/app/main.c
54-
55-
> niosv-shell
56-
57-
> cmake -S ./sw/app -B sw/app/build -G "Unix Makefiles"
58-
59-
> make -C sw/app/build
60-
61-
> elf2hex sw/app/build/app.elf -b 0x0 -w 32 -e 0x9ffff sw/app/build/onchip_mem.hex -r4
62-
63-
Note: Reduce the JTAG clock frequency to 6MHz before programming the application .elf file on the board.
64-
command: jtagconfig --setparam 1 JtagClock 6M
49+
- To create software app, run the following commands in the terminal:
50+
51+
- Clean the app build project before regenerating elf
52+
```
53+
niosv-bsp -c --quartus-project=hw/top.qpf --qsys=hw/qsys_top.qsys --type=hal sw/bsp/settings.bsp
54+
niosv-app --bsp-dir=sw/bsp --app-dir=sw/app --srcs=sw/app/main.c
55+
niosv-shell
56+
cmake -S ./sw/app -B sw/app/build -G "Unix Makefiles"
57+
make -C sw/app/build
58+
elf2hex sw/app/build/app.elf -b 0x0 -w 32 -e 0x9ffff sw/app/build/onchip_mem.hex -r4
59+
```
6560

6661
d. Hardware Validation
67-
- Program the generated sof and then download the elf file on the board
68-
69-
> quartus_pgm --cable=1 -m jtag -o 'p;ready_to_test/top.sof'
70-
71-
- Download the elf file on the board
72-
73-
> niosv-download -g ready_to_test/app.elf -c 1
74-
75-
- Verify the output on the terminal by using the following command in the terminal:
76-
77-
> juart-terminal -d 1 -c 1 -i 0
62+
- Program the generated sof and then download the elf file on the board
63+
```
64+
quartus_pgm --cable=1 -m jtag -o 'p;ready_to_test/top.sof'
65+
```
66+
- Reduce the JTAG clock frequency to 6MHz before programming the application .elf file on the board.
67+
```
68+
jtagconfig --setparam 1 JtagClock 6M
69+
```
70+
- Download the elf file on the board
71+
```
72+
niosv-download -g ready_to_test/app.elf -c 1
73+
```
74+
- Verify the output on the terminal by using the following command in the terminal:
75+
```
76+
juart-terminal -d 1 -c 1 -i 0
77+
```
7878

7979
### 4. Running simulation
8080

8181
Simulation is enabled for this design where the memory is initialized with the application hex. Use the following commands to run the simulation:
8282

83-
> Generate Testbench from Platform Designer. Generate -> Generate Testbench System
84-
85-
> cp ./sw/app/build/onchip_mem.hex ./*_tb/*_tb/sim/mentor
86-
87-
> cd hw/*_tb/*_tb/sim/mentor/
88-
89-
> vsim &
90-
91-
> source msim_setup.tcl
92-
93-
> ld_debug
94-
95-
> run -all
83+
- Generate Testbench from Platform Designer. Generate -> Generate Testbench System
84+
```
85+
cp ./sw/app/build/onchip_mem.hex ./qsys_top_tb/qsys_top_tb/sim/mentor
86+
cd hw/qsys_top_tb/qsys_top_tb/sim/mentor/
87+
vsim &
88+
source msim_setup.tcl
89+
ld_debug
90+
run -all
91+
```

0 commit comments

Comments
 (0)