Skip to content

Commit

Permalink
Update Tutorial Makefiles to move all unneeded core.elf.* files into …
Browse files Browse the repository at this point in the history
…their own directory. (Xilinx#342)

* Include iostream in test_library.h

* Make default target sim. To run: make -C sim

* Add visualization section to tutorial-4.

Add Advanced Topics: Pathfiner to tutorial-4/switchbox.

* Update Tutorial Makefiles to move all unneeded core.elf.* files into their own directory.

This could be done in aiecc.py, but rearranging these files might break other functions.

---------

Co-authored-by: msears <msears@amd.com>
  • Loading branch information
searsm8 and msears authored Feb 9, 2023
1 parent 40fc8da commit 4985062
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Targets/AIEFlowsToJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ mlir::LogicalResult AIEFlowsToJSON(ModuleOp module, raw_ostream &output) {
routeString += std::string(" ],\n");
output << routeString;
}
output << "\"route_all\": []\n";
output << "\"route_all\": [],\n";
output << "\n\"end json\": 0\n"; // dummy line to avoid errors from commas
output << "}";
return success();
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: core_1_4.elf
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-2/tutorial-2a/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-2a.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-2/tutorial-2b/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-2b.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-2/tutorial-2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-2c.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-3.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-3/objectFifo_ver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-3.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-4.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-4/flow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-4.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-4/flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ The reported performance counter value then gives the difference between the two
```
gtkwave ./answers/tutorial-4_perf.gtkw
```
which would look something like the link here: <a href="../../images/wave1.jpg"><img src="../../images/answer1.jpg" title="Click here for waveform picture." height=25></a>
which would look something like the link here: <a href="../../images/wave1.jpg"><img src="../../images/answer1.jpg" title="Click here for waveform picture." height=25></a>
3 changes: 3 additions & 0 deletions tutorials/tutorial-4/switchbox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-4.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial-4/switchbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The "East" output in %tile14 connects to the "West" input of %tile24, and so the
The lowering from abstract `AIE.flow` ops to physical `AIE.switchbox` and `AIE.wire` ops is accomplished with the `--aie-create-pathfinder-flows` pass. This pass uses an iterative congestion-aware algorithm to find legal routes for all flows in the AIE array. For each flow, Pathfinder creates a route using Djikstra's Shortest Path algorithm. When congestion occurs (too many routes want to use the same physical wires) then the "demand" for those high congestion wires is increased, and then Pathfinder runs another iteration. This repeats iteratively until all flows are legally mapped onto the available routing resources.

1. Examine `./path/pathfinder_input.mlir`. Here we are only interested in the routing of flows, so the core and memory sections have been removed. Instead we have a list of tiles and four flows which we want routed.
2. Run `make pathfinder` to perform the pass. Examine `./path/pathfinder_output.mlir` to see the results. How many switchboxes did the Pathfinder algorithm use in routing? <img src="../../images/answer1.jpg" title="There are 11 switchbox ops with detailed routing information in the output." height=25>
2. Run `make pathfinder` to perform the pass. Examine `./path/pathfinder_output.mlir` to see the results. How many switchboxes did the Pathfinder algorithm use in routing? <img src="../../images/answer1.jpg" title="There are 8 switchbox ops with detailed routing information in the output." height=25>
3. Open `./path/pathfinder_output.json` and run the prviewer extension by pressing F1 and running the `Routing View` command. After activating the extension, you will see only route0 displayed. To see all routes, hover over `route_all` at the bottom of `./path/pathfinder_output.json` and click `Display route_all` in the textbox that appears. You can also do the same to view only specific routes.
> Note: recall that the `prviewer` extension uses a (row, col) format for tile coordinates instead of (col, row) used in mlir.
4. Add a new flow in `./path/pathfinder_input.mlir`. For example, you could add a flow from tile (0, 3) to tile (4, 1). Run `make pathfinder` again to view the new routing.
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-5/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-5.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-5/flow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-5.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-6/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-6.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-7.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-7/flow/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-7.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-7/switchbox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-7.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line mlir-aie compile script "aiecc.py"
# Sysroot and host target used to cross compile host executable
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-8.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

# Command line AIE kernel compile. See tutorial-2 for more info.
%.o: %.cc
Expand Down
3 changes: 3 additions & 0 deletions tutorials/tutorial-9/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ endif
AIE_INSTALL = $(dir $(shell which aie-opt))/..

all: tutorial-9.exe
@mkdir -p elf
@mv *.elf* ./elf
@cp ./elf/*.elf ./elf/*.elf.map .

#external_kernel/work/Release_LLVM/test.prx/kernel.o: external_kernel/kernel.cc
# $(MAKE) -C external_kernel build
Expand Down

0 comments on commit 4985062

Please sign in to comment.