-
Notifications
You must be signed in to change notification settings - Fork 65
Benchmarking #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Benchmarking #11
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # | ||
| # Copyright 2021, Breakaway Consulting Pty. Ltd. | ||
| # | ||
| # SPDX-License-Identifier: BSD-2-Clause | ||
| # | ||
| ifeq ($(strip $(BUILD_DIR)),) | ||
| $(error BUILD_DIR must be specified) | ||
| endif | ||
|
|
||
| ifeq ($(strip $(SEL4CP_SDK)),) | ||
| $(error SEL4CP_SDK must be specified) | ||
| endif | ||
|
|
||
| ifeq ($(strip $(SEL4CP_BOARD)),) | ||
| $(error SEL4CP_BOARD must be specified) | ||
| endif | ||
|
|
||
| ifeq ($(strip $(SEL4CP_CONFIG)),) | ||
| $(error SEL4CP_CONFIG must be specified) | ||
| endif | ||
|
|
||
| TOOLCHAIN := aarch64-unknown-linux-gnu | ||
|
|
||
| CPU := cortex-a53 | ||
|
|
||
| CC := $(TOOLCHAIN)-gcc | ||
| LD := $(TOOLCHAIN)-ld | ||
| AS := $(TOOLCHAIN)-as | ||
| SEL4CP_TOOL ?= $(SEL4CP_SDK)/bin/sel4cp | ||
|
|
||
| SERVER_OBJS := server.o | ||
| CLIENT_OBJS := client.o | ||
|
|
||
| BOARD_DIR := $(SEL4CP_SDK)/board/$(SEL4CP_BOARD)/$(SEL4CP_CONFIG) | ||
|
|
||
| IMAGES := server.elf client.elf | ||
| CFLAGS := -mcpu=$(CPU) -mstrict-align -nostdlib -ffreestanding -g3 -O3 -Wall -Wno-unused-function -Werror -I$(BOARD_DIR)/include | ||
| LDFLAGS := -L$(BOARD_DIR)/lib | ||
| LIBS := -lsel4cp -Tsel4cp.ld | ||
|
|
||
| IMAGE_FILE = $(BUILD_DIR)/loader.img | ||
| REPORT_FILE = $(BUILD_DIR)/report.txt | ||
|
|
||
| all: $(IMAGE_FILE) | ||
|
|
||
| $(BUILD_DIR)/%.o: %.c Makefile | ||
| $(CC) -c $(CFLAGS) $< -o $@ | ||
|
|
||
| $(BUILD_DIR)/%.o: %.s Makefile | ||
| $(AS) -g3 -mcpu=$(CPU) $< -o $@ | ||
|
|
||
| $(BUILD_DIR)/server.elf: $(addprefix $(BUILD_DIR)/, $(SERVER_OBJS)) | ||
| $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ | ||
|
|
||
| $(BUILD_DIR)/client.elf: $(addprefix $(BUILD_DIR)/, $(CLIENT_OBJS)) | ||
| $(LD) $(LDFLAGS) $^ $(LIBS) -o $@ | ||
|
|
||
| $(IMAGE_FILE) $(REPORT_FILE): $(addprefix $(BUILD_DIR)/, $(IMAGES)) passive_server.system | ||
| $(SEL4CP_TOOL) passive_server.system --search-path $(BUILD_DIR) --board $(SEL4CP_BOARD) --config $(SEL4CP_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| * Copyright 2022, UNSW | ||
| * | ||
| * SPDX-License-Identifier: BSD-2-Clause | ||
| */ | ||
| #include <sel4cp.h> | ||
|
|
||
| #define SERVER_CH 0 | ||
|
|
||
| void | ||
| init(void) | ||
| { | ||
| sel4cp_dbg_puts("client: client protection domain init function running\n"); | ||
|
|
||
| /* message the server */ | ||
| sel4cp_mr_set(0, 0); | ||
| (void) sel4cp_ppcall(SERVER_CH, sel4cp_msginfo_new(1, 1)); | ||
| } | ||
|
|
||
| void | ||
| notified(sel4cp_channel ch) | ||
| { | ||
| sel4cp_dbg_puts("Client recieved a notification on an unexpected channel\n"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Copyright 2022, UNSW | ||
|
|
||
| SPDX-License-Identifier: BSD-2-Clause | ||
| --> | ||
| <system> | ||
| <protection_domain name="server" priority="100" pp="true" passive="true"> | ||
| <program_image path="server.elf" /> | ||
| </protection_domain> | ||
|
|
||
| <protection_domain name="client" priority="99"> | ||
| <program_image path="client.elf" /> | ||
| </protection_domain> | ||
|
|
||
| <channel> | ||
| <end pd="server" id="0" /> | ||
| <end pd="client" id="0" /> | ||
| </channel> | ||
|
|
||
| </system> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Copyright 2022, UNSW | ||
| * | ||
| * SPDX-License-Identifier: BSD-2-Clause | ||
| */ | ||
| #include <sel4cp.h> | ||
|
|
||
| sel4cp_msginfo | ||
| protected(sel4cp_channel ch, sel4cp_msginfo msginfo) | ||
| { | ||
| switch (sel4cp_msginfo_get_label(msginfo)) { | ||
| case 0: | ||
| sel4cp_dbg_puts("Server is running on clients scheduling context\n"); | ||
| break; | ||
| default: | ||
| sel4cp_dbg_puts("server received an unexpected message\n"); | ||
| } | ||
|
|
||
| return seL4_MessageInfo_new(0, 0, 0, 0); | ||
| } | ||
|
|
||
| void | ||
| init(void) | ||
| { | ||
| sel4cp_dbg_puts("server: server protection domain init function running\n"); | ||
| /* Nothing to initialise */ | ||
| } | ||
|
|
||
| void | ||
| notified(sel4cp_channel ch) | ||
| { | ||
| sel4cp_dbg_puts("Server recieved a notification on an unexpected channel\n"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid unrelated changes. In this case the trailing comma was intentional.
What we will do here in future is use: https://black.readthedocs.io/en/stable/index.html to auto-format all the Python code, which should avoid any of these issues.