Skip to content

Commit

Permalink
Merge pull request #355 from dd-vaibhavjain/vja_mtvec_align_issue_351
Browse files Browse the repository at this point in the history
Proposed Fix for issue #351 using new model macro RVMODEL_MTVEC_ALIGN
  • Loading branch information
neelgala authored Jun 22, 2023
2 parents 530fdbe + 39a797d commit e16fea1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# CHANGELOG

## [3.6.7] - 2023-06-22
- Specify new optional model macro RVMODEL_MTVEC_ALIGN to define new macro MTVEC_ALIGN in arch_test.h for issue #351

## [3.6.6] - 2023-06-17
- Removed stale zext.h-01.S test case superseded by zext.h_64-01.S

Expand Down
10 changes: 8 additions & 2 deletions riscv-test-suite/env/arch_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@
#define SIGALIGN FREGWIDTH
#endif

#ifndef RVMODEL_MTVEC_ALIGN
#define MTVEC_ALIGN 6 // ensure that a trampoline is on a typical cacheline boundary, just in case
#else
#define MTVEC_ALIGN RVMODEL_MTVEC_ALIGN //Let the model defined value be used for required trap handler alignment based on implemented MTVEC
#endif

//==============================================================================
// this section has RV Arch Test Constants, mostly YAML based.
// It ensures they're defined & defaulted if necessary)
Expand Down Expand Up @@ -930,7 +936,7 @@ rvtest_\__MODE__\()prolog_done:
.macro RVTEST_TRAP_HANDLER __MODE__
.option push
.option rvc // temporarily allow compress to allow c.nop alignment
.align 6 // ensure that a trampoline is on a typical cacheline boundary, just in case
.align MTVEC_ALIGN
.option pop

/**********************************************************************/
Expand Down Expand Up @@ -1755,4 +1761,4 @@ rvtest_\__MODE__\()end:
#endif
#endif
rvtest_data_end:
.endm
.endm
10 changes: 10 additions & 0 deletions spec/TestFormatSpec.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ This document has been created by the following people (in alphabetical order of
|================================================================================
| _Revision_ | _Date_ | _Author_ | _Modification_

| 1.2.9 Draft | 23 May 2023 | Vaibhav Jain |
* Added description for RVMODEL_MTVEC_ALIGN macro under - Optional, Model-defined Macros Section

| 1.2.8 Draft | 16 December 2022 | S Pawan Kumar |
* Size constraint of signature region updated to multiple of 4.
* Added section to describe CondStr of RVTEST_CASE macro.
Expand Down Expand Up @@ -509,6 +512,13 @@ the test.
- Currently the test forces an empty macro if a target does not declare this. Future tests may
change this.

`RVMODEL_MTVEC_ALIGN`::
- This macro is to specify an integer number for a ".align" assembler directive related to trap handler's
start address. This is based on alignment restriction, if any, as dictated by an implementation specific MTVEC.
- Currently the resulting default value for corresponding .align directive, if a target does not declare
this macro is 6. Thus resulting in ".align 6" as directive for trap handler start address, or a 64-byte
aligned location. Future tests may change this.

=== Required labels

The test must define a `rvtest_entry_point` label to indicate the location to be used by the linker
Expand Down

0 comments on commit e16fea1

Please sign in to comment.