Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-06-11 Thread Alistair Francis
On Fri, Jun 9, 2023 at 6:37 PM Tommy Wu wrote: > > Hi Alistair, > Thanks for the suggestion! Do you mean > ``` > ... > g_free(cpu->dyn_csr_xml); > riscv_gen_dynamic_csr_xml(cs, cpu-> gdb_num_regs - CSR_TABLE_SIZE); > ... > ``` ? Yeah, pretty much. We already have cpu-> gdb_num_r

Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-06-09 Thread Tommy Wu
Hi Alistair, Thanks for the suggestion! Do you mean ``` ... g_free(cpu->dyn_csr_xml); riscv_gen_dynamic_csr_xml(cs, cpu-> gdb_num_regs - CSR_TABLE_SIZE); ... ``` ? Or maybe we don't need this refresh function, and just add ext_ssaia & ext_smaia in the command line. Best Regards,

Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-05-24 Thread Alistair Francis
On Tue, May 23, 2023 at 9:46 PM Tommy Wu wrote: > > When we change the cpu extension state after the cpu is > realized, we cannot print the value of some CSRs in the remote > gdb debugger. The root cause is that the dynamic CSR xml is > generated when the cpu is realized. > > This patch add a func

Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-05-23 Thread Weiwei Li
On 2023/5/24 13:35, Tommy Wu wrote: Hi WeiWei Li, When the CPU is realizing, it will call `riscv_gen_dynamic_csr_xml` for the first time with the correct `base_reg` value. code flow : riscv_cpu_realize → riscv_cpu_register_gdb_regs_for_features  → riscv_gen_dynamic_csr_xml The fu

Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-05-23 Thread Tommy Wu
Hi WeiWei Li, When the CPU is realizing, it will call `riscv_gen_dynamic_csr_xml` for the first time with the correct `base_reg` value. code flow : riscv_cpu_realize → riscv_cpu_register_gdb_regs_for_features → riscv_gen_dynamic_csr_xml The functionality of `cpu->dyn_csr_base_reg` is to

Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-05-23 Thread Weiwei Li
On 2023/5/24 09:59, Tommy Wu wrote: Hi Weiwei Li, `dyn_csr_base_reg` will be used in `riscv_refresh_dynamic_csr_xml` We can initialize this variable when the cpu is realized. I didn't find this initialization in following code. And used this variable in `riscv_refresh_dynamic_csr_xml`. Tha

Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-05-23 Thread Tommy Wu
Hi Weiwei Li, `dyn_csr_base_reg` will be used in `riscv_refresh_dynamic_csr_xml` We can initialize this variable when the cpu is realized. And used this variable in `riscv_refresh_dynamic_csr_xml`. Best regards, Tommy On Tue, May 23, 2023 at 10:38 PM Weiwei Li wrote: > > On 2023/5/23 19:44, T

Re: [PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-05-23 Thread Weiwei Li
On 2023/5/23 19:44, Tommy Wu wrote: When we change the cpu extension state after the cpu is realized, we cannot print the value of some CSRs in the remote gdb debugger. The root cause is that the dynamic CSR xml is generated when the cpu is realized. This patch add a function to refresh the dy

[PATCH 1/2] target/riscv: Add a function to refresh the dynamic CSRs xml.

2023-05-23 Thread Tommy Wu
When we change the cpu extension state after the cpu is realized, we cannot print the value of some CSRs in the remote gdb debugger. The root cause is that the dynamic CSR xml is generated when the cpu is realized. This patch add a function to refresh the dynamic CSR xml after the cpu is realized.