-
Notifications
You must be signed in to change notification settings - Fork 18
Implement the compressed instructions #5
base: master
Are you sure you want to change the base?
Conversation
Remove the generated files and rework! |
CSRs.h
Outdated
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ |
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.
The range from Line 1 to 68 is not necessary. Remove these lines.
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.
?
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.
Sor, I may forget about it.
Hint: use |
Sorry, I have a question. |
Yes, all commits should be reworked. You shall squash the similar changes and make the commits clear. |
Hello, Jserv |
After reworking Git commits with |
@@ -1,19 +1,60 @@ | |||
BINS = emu-rv32i test1 | |||
TEST_TARGETS = \ |
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.
Send another pull request for adding RISC-V test cases.
Ensure no generated files such as ELF, log, dump files in Git repository. |
You have to rebase |
Don't use |
Reference instructions:
|
CSRs.h
Outdated
|
||
#include <stdint.h> | ||
|
||
|
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.
Can you introduce a dedicated structure for preserving the following fields?
emu-rv32i.c
Outdated
After this you can run it with the emulator like this: | ||
emu-rv32i zephyr/zephyr.elf | ||
original copyright: | ||
*/ |
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.
Remove the range from Line 1 to Line 35.
emu-rv32i.c
Outdated
// #define DEBUG_OUTPUT | ||
// #define DEBUG_EXTRA | ||
#define DEBUG_OUTPUT | ||
#define DEBUG_EXTRA |
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.
Don't do that.
emu-rv32i.c
Outdated
#define DEBUG_EXTRA | ||
|
||
#if 1 | ||
#define RV32C |
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.
RV32C
should be assigned via Makefile
emu-rv32i.c
Outdated
""}; | ||
#define C_STATS_NUM 64 | ||
|
||
#ifndef RV32C |
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.
I would like to use the following:
char statnames[STATS_NUM + C_STATS_NUM][16] = {
... /* RV32I instructions */
#if defined(RV32C)
... /* RV32C specific instructions */
#endif
}
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.
OK! It's more structural.
emu-rv32i.c
Outdated
maxmemr = maxmemw = 0; | ||
for(int i=0;i<STATS_NUM;i++) stats[i]=0; | ||
#ifdef RV32C | ||
for(int i=0;i<C_STATS_NUM;i++) stats[i+64] = 0; |
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.
Ditto. You can define macro for the range. Thus, we don't have to duplicate the loops.
Before submitting the changes, ensure the completion of executing |
Reworked yet? |
Not yet,
I will update it tomorrow.
Jim Huang <[email protected]> 於 2020年1月17日 週五 上午1:10寫道:
… Reworked yet?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<sysprog21/rv32emu#5?email_source=notifications&email_token=AI4KYTPOEE7CU32GFLJLIVDQ6CIGPA5CNFSM4KFQ6NU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJE2HLQ#issuecomment-575251374>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AI4KYTOCJ6566MQXVGGPNSDQ6CIGPANCNFSM4KFQ6NUQ>
.
|
Add the method of how to test file
Add the C.JAL and C.ADDIW insn
Delete the unnecessary file
Hello Jserv, |
sig.txt | ||
rom.v | ||
debug.txt | ||
CSR.h |
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.
CSR.h
was tracked in GIT repository.
@@ -23,6 +24,8 @@ | |||
// #define DEBUG_OUTPUT | |||
// #define DEBUG_EXTRA | |||
|
|||
|
|||
/* added by Shaos: */ |
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.
You don't have to mention the contributor name inside source file.
@@ -140,7 +163,7 @@ uint64_t mtimecmp; | |||
/* virtual start address for index 0 in the ram array */ | |||
uint32_t ram_start; | |||
|
|||
/* program entry point */ | |||
/* Program entry point */ |
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.
Don't do that. Let's minimize the changes.
/* CPU state */ | ||
uint32_t pc; | ||
uint32_t next_pc; | ||
uint32_t insn; | ||
uint32_t reg[32]; | ||
|
||
|
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.
Ditto. Minimize the changes.
Thank @kksweet8845 again for contributing to this project. However, we shall always merge commits with better Git commit messages for further development. Please split this pull request into the following:
Changes regarding |
Some modification of rv32emu to support C ext.
insn_type
to distinguish the 16-bit and 32-bit instruction.unsigned char get_insn32(uint32_t, uint32_t*)
to return the type of instruction and then assign the pointer the machine code of the instruction.Future work