Skip to content

Commit

Permalink
Release 2024.10
Browse files Browse the repository at this point in the history
This release is stable enough to run single thread simulation.
Multicore simulation also run, but wasn't yet tested in >10M cycles simulation
More information in the release notes
  • Loading branch information
branylagaffe authored Oct 4, 2024
2 parents a82d3da + afb2959 commit 85f02de
Show file tree
Hide file tree
Showing 13 changed files with 550 additions and 128 deletions.
27 changes: 27 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = false

# Unix-style newlines with a newline ending every file
[*]
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Matches the exact files either package.json or .travis.yml
[*.{json,yml,yaml,toml}]
indent_style = space
indent_size = 2
19 changes: 6 additions & 13 deletions .github/workflows/00-build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


name: Build Binaries
run-name: '[${{ github.event_name }}] ${{ github.ref_name }}'

Expand All @@ -18,19 +16,14 @@ on:
- 'docs/**'
- '*.md'

#TODO: Once 'main' is replaced
# schedule:
# # Every Wednesday at midnight
# - cron: '0 0 * * 3'

# Full concurrent
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

# Develop build only for weekly build
# Maight be set dynamically
env:
debug: ${{ (github.event_name == 'schedule') && 'debug' || 'release' }}
debug: release

jobs:
# Scan the working directory to trigger build based on
Expand Down Expand Up @@ -58,7 +51,7 @@ jobs:
build_simulator:
name: Build Simulators
needs: paths-filter
if: ${{ (needs.paths-filter.outputs.flexus == 'true') || github.event_name == 'schedule' }}
if: ${{ (needs.paths-filter.outputs.flexus == 'true') }}
env:
CC: gcc-13
CXX: g++-13
Expand All @@ -75,7 +68,7 @@ jobs:
- name: Checkout QFlex
uses: actions/checkout@v4
with:
submodules: true
submodules: recursive

- uses: actions/setup-python@v5
with:
Expand All @@ -94,7 +87,7 @@ jobs:
build_qemu:
name: Build Qemu
needs: paths-filter
if: ${{ (needs.paths-filter.outputs.qemu == 'true') || github.event_name == 'schedule' }}
if: ${{ (needs.paths-filter.outputs.qemu == 'true') }}

runs-on: ubuntu-latest
container:
Expand All @@ -104,7 +97,7 @@ jobs:
- name: Checkout QFlex
uses: actions/checkout@v4
with:
submodules: true
submodules: recursive

- name: Build
run: ./build cq ${{ env.debug }}
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "flexus"]
path = flexus
url = [email protected]:parsa-epfl/flexus.git
branch = master
branch = maintainer/bryan
[submodule "qemu"]
path = qemu
url = [email protected]:parsa-epfl/qemu.git
branch = master
branch = next
42 changes: 42 additions & 0 deletions 2x3-mesh.topology
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Boilerplate stuff
ChannelLatency 1
ChannelLatencyData 4
ChannelLatencyControl 1
LocalChannelLatencyDivider 4
SwitchInputBuffers 1
SwitchOutputBuffers 1
SwitchInternalBuffersPerVC 1

# Basic Switch/Node connections
NumNodes 6
NumSwitches 2
SwitchPorts 7
SwitchBandwidth 4

Top Node 0 -> Switch 0:0
Top Node 1 -> Switch 1:0
Top Node 2 -> Switch 0:1
Top Node 3 -> Switch 1:1
Top Node 4 -> Switch 0:2
Top Node 5 -> Switch 1:2

# Topology for a 6 node MESH with 3 nodes per router
Top Switch 0:5 -> Switch 1:3

# Deadlock-free routing tables

# Switch 0 -> *
Route Switch 0 -> 0 { 0:0 }
Route Switch 0 -> 1 { 5:0 }
Route Switch 0 -> 2 { 1:0 }
Route Switch 0 -> 3 { 5:0 }
Route Switch 0 -> 4 { 2:0 }
Route Switch 0 -> 5 { 5:0 }

# Switch 1 -> *
Route Switch 1 -> 0 { 3:0 }
Route Switch 1 -> 1 { 0:0 }
Route Switch 1 -> 2 { 3:0 }
Route Switch 1 -> 3 { 1:0 }
Route Switch 1 -> 4 { 3:0 }
Route Switch 1 -> 5 { 2:0 }
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

## [🎯 Features](#features)

***Functional-First**. 30 MIPS functional first simulation.
* 🕰 **Timing-First**. 100 KIPS cycle-accurate simulation.
***Functional-First**. 1 MIPS functional first simulation.
* 🕰 **Timing-First**. 70 KIPS cycle-accurate simulation.
* 🗂️ **Components-based**. Create custom components.
***Free**. QFlex is completely free and open source.

Expand Down Expand Up @@ -55,18 +55,17 @@ ln -s qemu/build/aarch64-softmmu/qemu-system-aarch64 qemu-aarch64

### 6. Add Images

[Download a simple image](https://github.com/parsa-epfl/qflex/releases/download/2024.05/images.tar.xz) and place it the
[Download a simple image](https://github.com/parsa-epfl/qflex/releases/latest/) and place it the
repository root location.

```sh
wget https://github.com/parsa-epfl/qflex/releases/download/2024.05/images.tar.xz
wget https://github.com/parsa-epfl/qflex/releases/latest/download/images.tar.xz
tar -xvf images.tar.xz
```

The repository tree under images folder should look like this.

```
images/
├── busybox
└── Busybox
Expand All @@ -78,7 +77,7 @@ images/
### 7. Run
```sh
./runq images/bb-trace # run keenkraken release version
./runq images/bb-timing-dev # run knottykraken debug version
./runq images/bb-timing # run knottykraken release version
```
The filesystem now contains basic tools provided by `/bin/busybox` like `ls`, `cd`, etc.

Expand All @@ -97,7 +96,6 @@ Made with [contrib.rocks](https://contrib.rocks).
This software is an open-sourced software licensed under the following license:

```text
***Software developed externally (not by the QFlex group)***
QFlex consists of several software components that are governed by various
Expand Down Expand Up @@ -138,4 +136,4 @@ GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
```
10 changes: 7 additions & 3 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ case $SIM in
if [ "$BUILD_TYPE" = "debug" ]; then
./configure --target-list=aarch64-softmmu \
--disable-docs \
--enable-capstone \
--enable-slirp \
--enable-savevm-external \
--enable-libqflex \
--enable-debug \
Expand All @@ -35,18 +37,20 @@ case $SIM in
else
./configure --target-list=aarch64-softmmu \
--disable-docs \
--enable-capstone \
--enable-slirp \
--enable-savevm-external \
--enable-libqflex

fi
popd
make -C qemu -j4
make -C qemu -j
;;
[Qq])
make -C qemu -j4
make -C qemu -j
;;
*)
echo "Never heard of '${SIM}'"
exit 1
;;
esac
esac
109 changes: 109 additions & 0 deletions docs/02-RUNQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
RUNQ
====

This document shows all about how to run any of the uArch simulators (KeenKraken & KnottyKraken).

## Config File
QFlex uses two differents type configuration files.

The first is a custom file version of a QEMU invokation arguments. The file type can have any name and any extension.

The second, `trace.cfg` and `timing.cfg` are used to configure KeenKraken or KnottyKraken. They are written in a specific structure only parsable by Flexus. The file type can have any name and any extension.

### QEMU Config

The config file is pure text, and shall follow the following standard.
- Top level options should be written without any dash (-) nor any whitespaces prepended
- 2nd level options needs to be indented with the same amount of whitespace along the file.

All key-value arguments whether top or second level, needs a space between their key and their valu.


```txt
nographic
machine
virt
gic-version max
virtualization on
cpu
max
pauth off
parallel
none
m
4G
rtc
clock vm
```

The config contains three variables defined by `runQ`.
- ROOT: Give the location where the `runQ` executable is located
- SMP: The number of core to use for the next run, default=1
- EXTRA: Arbitry command passed by the command line, usually used to add uArch simulator specific arguments

```txt
kernel
${ROOT}/Busybox/Image
smp
${SMP}
drive
file ${ROOT}/Busybox/rootfs.qcow2
format qcow2
if virtio
libqflex
mode trace
lib-path ${ROOT}/../out/keenkraken/Debug/libkeenkraken.so
cfg-path ${ROOT}/../trace.cfg
debug vverb
${EXTRA}
```

### uArch Config
`trace.cfg` and `timing.cfg` files contains variables definition that will overload the default ones. The best way to change the configuration is to rely on the file themselves and their documentation.

## runQ
This utility is written in pure Python. There is no requirement on the python verison; 3.11.9 is version known to work.

Before using `runQ` you may want to make the file executable using `chmod +x runq`. `runQ` have an information page accessible using `./runq -h`.

### Basic

`runQ` must take a configuration file as input.

```bash
./runq my_dir/my_config
```

The number of cores can be changed easily using `--smp`.

```bash
./runq my_dir/my_config --smp 64
```

### Debug

`runQ` contains debug options:
- `-d`,`--dry` : Print QEMU start command instead of executing it
- `-b`,`--binary` : Set a custom binary to uses instead of looking in the current working directory
- `--gdb` : Start a GDB instance an execute the command in it

### Simulator

The extra flags `-e`, or `--extra` can be used to add arguments to an existing configuration file. The argument will be set in place of the ${EXTRA} placeholder.

```txt
libqflex
mode trace
lib-path ${ROOT}/../out/keenkraken/Debug/libkeenkraken.so
cfg-path ${ROOT}/../trace.cfg
debug vverb
${EXTRA}
```
Loading

0 comments on commit 85f02de

Please sign in to comment.