Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

nbdd0121
Copy link
Contributor

Pull Request Overview

Fix two (non-fatal) errors when running QEMU tests with OpenTitan boards.

The assignment in Makefile is unconditional (and will run regardless if ot-check target is needed), so git will complain that $HOME is not a git repo if OPENTITAN_TREE is not set.

cargo test runs run.sh which needs TOCK_ROOT_DIRECTORY. This is set for test-hardware and test-verilator but is not currently set for test target.

Testing Strategy

make -C boards/opentitan/earlgrey-cw310/ test

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

@github-actions github-actions bot added the WG-OpenTitan In the purview of the OpenTitan working group. label Jun 29, 2023
lschuermann
lschuermann previously approved these changes Jun 29, 2023
@lschuermann lschuermann added the P-Upkeep This a relatively minor change, or one that is limited in scope, and requires less scrutiny. label Jun 29, 2023
@@ -32,7 +32,9 @@ endif
CARGO_FLAGS += -Zpanic-abort-tests

.PHONY: ot-check
OPENTITAN_ACTUAL_SHA := $(shell cd $(OPENTITAN_TREE); git show --pretty=format:"%H" --no-patch)
ifeq ($(OPENTITAN_TREE),)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this check that if OPENTITAN_TREE is not set, then set OPENTITAN_ACTUAL_SHA?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is suppsoed to be ifneq, somehow I messed things up rebasing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is caught by the below test for OPENTITAN_ACTUAL_SHA == OPENTITAN_SUPPORTED_SHA (which will be false when empty, and can be overridden by SKIP_OT_VERSION_CHECK). The OPENTITAN_ACTUAL_SHA seem to be really only used for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I messed up with spacing and tabs as well. 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is caught by the below test for OPENTITAN_ACTUAL_SHA == OPENTITAN_SUPPORTED_SHA (which will be false when empty, and can be overridden by SKIP_OT_VERSION_CHECK). The OPENTITAN_ACTUAL_SHA seem to be really only used for that.

I guess it's probably worth cleaning up that logic as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out there's not much to cleanup. We need to set the OPENTITAN_ACTUAL_SHA variable before the ot-check target because you can't mix variable assignment with recipes.

Comment on lines -105 to -106
# Test layout should be removed so that following apps (non-test) load the correct layout.
$(Q)rm $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/deps/layout.ld
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed?

Copy link
Contributor Author

@nbdd0121 nbdd0121 Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run.sh already contains the code to delete the file. It's currently only needed because without TOCK_ROOT_DIRECTORY and TARGET being passed, the rm in run.sh failed.

@bradjc bradjc added this pull request to the merge queue Jun 29, 2023
Merged via the queue into tock:master with commit 9083376 Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-Upkeep This a relatively minor change, or one that is limited in scope, and requires less scrutiny. WG-OpenTitan In the purview of the OpenTitan working group.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants