Skip to content
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

vcs: add finish_device for simv_finish #324

Merged
merged 5 commits into from
Apr 3, 2024

Conversation

xiaokamikami
Copy link
Contributor

Used to release peripherals upon reset

@xiaokamikami xiaokamikami requested a review from klin02 March 28, 2024 03:39
@klin02
Copy link
Member

klin02 commented Mar 28, 2024

Please format PR title and message

@xiaokamikami xiaokamikami changed the title Finish device vcs: add finish device on reset Mar 28, 2024
@@ -60,6 +60,12 @@ void init_sdl() {
SDL_SetWindowTitle(window, "NOOP");
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, SCREEN_W, SCREEN_H);
}

void finish_sdl() {
for (size_t i = 0; i < SCREEN_H; i++) {
Copy link
Member

Choose a reason for hiding this comment

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

Why for loop here? Seems SCREEN_W * SCREEN_H is OK

@klin02
Copy link
Member

klin02 commented Apr 2, 2024

type_t array[xx];
memset (array, 0, size(array));

@@ -106,3 +106,9 @@ static void preset_input() {
void init_uart(void) {
preset_input();
}

void finish_uart(void) {
memset((void *)&queue, 0, QUEUE_SIZE * sizeof(char));
Copy link
Member

Choose a reason for hiding this comment

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

Modify memset here.

@@ -60,6 +60,10 @@ void init_sdl() {
SDL_SetWindowTitle(window, "NOOP");
texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, SCREEN_W, SCREEN_H);
}

void finish_sdl() {
memset(vmem, 0, SCREEN_H * SCREEN_W * sizeof(vmem));
Copy link
Member

@klin02 klin02 Apr 2, 2024

Choose a reason for hiding this comment

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

sizeof(vmem) equals H*W*size(uint32_t)
Simply sizeof(vmem) is OK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okok

@klin02 klin02 changed the title vcs: add finish device on reset vcs: add finish_device to simv_finish Apr 2, 2024
@klin02 klin02 changed the title vcs: add finish_device to simv_finish vcs: add finish_device for simv_finish Apr 2, 2024
@klin02 klin02 merged commit a4e01f7 into OpenXiangShan:master Apr 3, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants