goossens-springer / goossens-book-ip-projects

this repository contains all the ip projects presented in the HLS/RISC-V/Computer Architecture book written by Goossens and published by Springer
21 stars 8 forks source link

fde_ip and fetching_decode_ip do not display correct instruction count #5

Open atreistm opened 3 weeks ago

atreistm commented 3 weeks ago

I am using Vivado and Vitis 2024 with an Arty Z7-20 board.

When I run the second or third steps of the single cycle implementation, I get 1 fetched and decoded instructions instead of 14. I saw one suggestion to make nbi a static (in the Vitis application?) but it did not help.

When I run a C-Simulation , the Vitis HLS project prints properly.

Any ideas?

goossens-springer commented 3 weeks ago

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction);
decode(instruction, &d_i);
execute(pc, d_i, &pc);
statistic_update(nb_instruction);
running_cond_update(instruction, &is_running);

} while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

atreistm commented 2 weeks ago

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.>>

goossens-springer commented 2 weeks ago

Hello Avi,

You probably forgot to initialize *nb_instruction to 0 before the loop. This why you had no " XFetching_decoding_ip_Get_nb_instruction" function but rather a "XFetching_decoding_ip_Get_nb_instruction_o" one. (in fact I had forgotten the initialization myself !!)

By the way, what is strange is that in later experiments, I use a "nb_cycle" counter similar to the "nb_instruction" one. This counter is computed through an intermediate "nbc" one (like nb_instruction was computed via "nbi"). The number of cycles is computed correctly (through "nbc"), but not "nb_instruction". No explanation.

The "fetching_decoding_ip" function code should be :

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

I also noticed that they removed "XPAR_XFETCHING_DECODING_IP_0_DEVICE_0" !!

Bernard.

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 11:53:30 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306730899 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5GY7U2IUYQ2KRKOUZITZS4BBVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWG4ZTAOBZHE | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306730899 @ github . com>

atreistm commented 2 weeks ago

I added the initialization to 0. So now I have XFetching_decoding_ip_Get_nb_instruction back. But now the function returns 0! I tried making everything again – still 0. It feels like the *nb_instruction = 0 is generated at the beginning, and the rest of the code is optimized out.

From: goossens-springer @.> Sent: Friday, August 23, 2024 1:33 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello Avi,

You probably forgot to initialize *nb_instruction to 0 before the loop. This why you had no " XFetching_decoding_ip_Get_nb_instruction" function but rather a "XFetching_decoding_ip_Get_nb_instruction_o" one. (in fact I had forgotten the initialization myself !!)

By the way, what is strange is that in later experiments, I use a "nb_cycle" counter similar to the "nb_instruction" one. This counter is computed through an intermediate "nbc" one (like nb_instruction was computed via "nbi"). The number of cycles is computed correctly (through "nbc"), but not "nb_instruction". No explanation.

The "fetching_decoding_ip" function code should be :

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

I also noticed that they removed "XPAR_XFETCHING_DECODING_IP_0_DEVICE_0" !!

Bernard.

De: "Avraham Treistman" @.<mailto:@.>> À: "goossens-springer" @.<mailto:@.>> Cc: "Bernard Goossens" @.<mailto:@.>>, "Comment" @.<mailto:@.>> Envoyé: Vendredi 23 Août 2024 11:53:30 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.<mailto:@.>> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.<mailto:@.>> Cc: Avi Treistman @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306730899 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5GY7U2IUYQ2KRKOUZITZS4BBVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWG4ZTAOBZHE | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306730899 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306802050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOSBD6HGWY5B6LCFWRTZS4FVXAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHAYDEMBVGA. You are receiving this because you authored the thread.Message ID: @.**@.>>

goossens-springer commented 2 weeks ago

I'll try tonight with 2023.2. It worked on 2024.1 for sure !

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:20:51 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I added the initialization to 0. So now I have XFetching_decoding_ip_Get_nb_instruction back. But now the function returns 0! I tried making everything again – still 0. It feels like the *nb_instruction = 0 is generated at the beginning, and the rest of the code is optimized out.

From: goossens-springer @.> Sent: Friday, August 23, 2024 1:33 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello Avi,

You probably forgot to initialize *nb_instruction to 0 before the loop. This why you had no " XFetching_decoding_ip_Get_nb_instruction" function but rather a "XFetching_decoding_ip_Get_nb_instruction_o" one. (in fact I had forgotten the initialization myself !!)

By the way, what is strange is that in later experiments, I use a "nb_cycle" counter similar to the "nb_instruction" one. This counter is computed through an intermediate "nbc" one (like nb_instruction was computed via "nbi"). The number of cycles is computed correctly (through "nbc"), but not "nb_instruction". No explanation.

The "fetching_decoding_ip" function code should be :

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

I also noticed that they removed "XPAR_XFETCHING_DECODING_IP_0_DEVICE_0" !!

Bernard.

De: "Avraham Treistman" @.<mailto:@.>> À: "goossens-springer" @.<mailto:@.>> Cc: "Bernard Goossens" @.<mailto:@.>>, "Comment" @.<mailto:@.>> Envoyé: Vendredi 23 Août 2024 11:53:30 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.<mailto:@.>> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.<mailto:@.>> Cc: Avi Treistman @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306730899 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5GY7U2IUYQ2KRKOUZITZS4BBVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWG4ZTAOBZHE | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306730899 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306802050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOSBD6HGWY5B6LCFWRTZS4FVXAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHAYDEMBVGA. You are receiving this because you authored the thread.Message ID: @.**@.>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306978075 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G7X7DS3IAFVXJXGYM3ZS4SKHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHE3TQMBXGU | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306978075 @ github . com>

atreistm commented 2 weeks ago

OK, I'll try it on 2024 again. Are you on windows or Linux?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: goossens-springer @.> Sent: Friday, August 23, 2024 3:39:47 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I'll try tonight with 2023.2. It worked on 2024.1 for sure !

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:20:51 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I added the initialization to 0. So now I have XFetching_decoding_ip_Get_nb_instruction back. But now the function returns 0! I tried making everything again – still 0. It feels like the *nb_instruction = 0 is generated at the beginning, and the rest of the code is optimized out.

From: goossens-springer @.> Sent: Friday, August 23, 2024 1:33 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello Avi,

You probably forgot to initialize *nb_instruction to 0 before the loop. This why you had no " XFetching_decoding_ip_Get_nb_instruction" function but rather a "XFetching_decoding_ip_Get_nb_instruction_o" one. (in fact I had forgotten the initialization myself !!)

By the way, what is strange is that in later experiments, I use a "nb_cycle" counter similar to the "nb_instruction" one. This counter is computed through an intermediate "nbc" one (like nb_instruction was computed via "nbi"). The number of cycles is computed correctly (through "nbc"), but not "nb_instruction". No explanation.

The "fetching_decoding_ip" function code should be :

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

I also noticed that they removed "XPAR_XFETCHING_DECODING_IP_0_DEVICE_0" !!

Bernard.

De: "Avraham Treistman" @.<mailto:@.>> À: "goossens-springer" @.<mailto:@.>> Cc: "Bernard Goossens" @.<mailto:@.>>, "Comment" @.<mailto:@.>> Envoyé: Vendredi 23 Août 2024 11:53:30 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.<mailto:@.>> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.<mailto:@.>> Cc: Avi Treistman @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306730899 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5GY7U2IUYQ2KRKOUZITZS4BBVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWG4ZTAOBZHE | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306730899 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306802050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOSBD6HGWY5B6LCFWRTZS4FVXAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHAYDEMBVGA. You are receiving this because you authored the thread.Message ID: @.**@.>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306978075 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G7X7DS3IAFVXJXGYM3ZS4SKHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHE3TQMBXGU | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306978075 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2307009642, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOTK3ZFKTMV3GIX7DN3ZS4URHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGAYDSNRUGI. You are receiving this because you authored the thread.Message ID: @.***>

goossens-springer commented 2 weeks ago

Linux, 20.04

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:44:42 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

OK, I'll try it on 2024 again. Are you on windows or Linux?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: goossens-springer @.> Sent: Friday, August 23, 2024 3:39:47 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I'll try tonight with 2023.2. It worked on 2024.1 for sure !

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:20:51 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I added the initialization to 0. So now I have XFetching_decoding_ip_Get_nb_instruction back. But now the function returns 0! I tried making everything again – still 0. It feels like the *nb_instruction = 0 is generated at the beginning, and the rest of the code is optimized out.

From: goossens-springer @.> Sent: Friday, August 23, 2024 1:33 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello Avi,

You probably forgot to initialize *nb_instruction to 0 before the loop. This why you had no " XFetching_decoding_ip_Get_nb_instruction" function but rather a "XFetching_decoding_ip_Get_nb_instruction_o" one. (in fact I had forgotten the initialization myself !!)

By the way, what is strange is that in later experiments, I use a "nb_cycle" counter similar to the "nb_instruction" one. This counter is computed through an intermediate "nbc" one (like nb_instruction was computed via "nbi"). The number of cycles is computed correctly (through "nbc"), but not "nb_instruction". No explanation.

The "fetching_decoding_ip" function code should be :

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

I also noticed that they removed "XPAR_XFETCHING_DECODING_IP_0_DEVICE_0" !!

Bernard.

De: "Avraham Treistman" @.<mailto:@.>> À: "goossens-springer" @.<mailto:@.>> Cc: "Bernard Goossens" @.<mailto:@.>>, "Comment" @.<mailto:@.>> Envoyé: Vendredi 23 Août 2024 11:53:30 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.<mailto:@.>> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.<mailto:@.>> Cc: Avi Treistman @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306730899 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5GY7U2IUYQ2KRKOUZITZS4BBVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWG4ZTAOBZHE | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306730899 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306802050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOSBD6HGWY5B6LCFWRTZS4FVXAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHAYDEMBVGA. You are receiving this because you authored the thread.Message ID: @.**@.>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306978075 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G7X7DS3IAFVXJXGYM3ZS4SKHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHE3TQMBXGU | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306978075 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2307009642, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOTK3ZFKTMV3GIX7DN3ZS4URHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGAYDSNRUGI. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2307018702 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G5F4FKWW2U4RQLOO2TZS4VDVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGAYTQNZQGI | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2307018702 @ github . com>

goossens-springer commented 2 weeks ago

If I have time, I'll deposit a full tar.gz archive of my fetching_decoding_ip project on my google drive and give you the link tonight (I take a plane early in the morning tomorrow for a 2 weeks vacation, so I hope we'll sort this out before I leave ; I do access my mail when on holiday but I won't have much free time to work though).

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Vendredi 23 Août 2024 15:06:52 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Linux, 20.04

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:44:42 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

OK, I'll try it on 2024 again. Are you on windows or Linux?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: goossens-springer @.> Sent: Friday, August 23, 2024 3:39:47 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I'll try tonight with 2023.2. It worked on 2024.1 for sure !

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:20:51 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I added the initialization to 0. So now I have XFetching_decoding_ip_Get_nb_instruction back. But now the function returns 0! I tried making everything again – still 0. It feels like the *nb_instruction = 0 is generated at the beginning, and the rest of the code is optimized out.

From: goossens-springer @.> Sent: Friday, August 23, 2024 1:33 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello Avi,

You probably forgot to initialize *nb_instruction to 0 before the loop. This why you had no " XFetching_decoding_ip_Get_nb_instruction" function but rather a "XFetching_decoding_ip_Get_nb_instruction_o" one. (in fact I had forgotten the initialization myself !!)

By the way, what is strange is that in later experiments, I use a "nb_cycle" counter similar to the "nb_instruction" one. This counter is computed through an intermediate "nbc" one (like nb_instruction was computed via "nbi"). The number of cycles is computed correctly (through "nbc"), but not "nb_instruction". No explanation.

The "fetching_decoding_ip" function code should be :

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

I also noticed that they removed "XPAR_XFETCHING_DECODING_IP_0_DEVICE_0" !!

Bernard.

De: "Avraham Treistman" @.<mailto:@.>> À: "goossens-springer" @.<mailto:@.>> Cc: "Bernard Goossens" @.<mailto:@.>>, "Comment" @.<mailto:@.>> Envoyé: Vendredi 23 Août 2024 11:53:30 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.<mailto:@.>> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.<mailto:@.>> Cc: Avi Treistman @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306730899 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5GY7U2IUYQ2KRKOUZITZS4BBVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWG4ZTAOBZHE | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306730899 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306802050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOSBD6HGWY5B6LCFWRTZS4FVXAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHAYDEMBVGA. You are receiving this because you authored the thread.Message ID: @.**@.>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306978075 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G7X7DS3IAFVXJXGYM3ZS4SKHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHE3TQMBXGU | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306978075 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2307009642, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOTK3ZFKTMV3GIX7DN3ZS4URHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGAYDSNRUGI. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2307018702 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G5F4FKWW2U4RQLOO2TZS4VDVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGAYTQNZQGI | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2307018702 @ github . com>

goossens-springer commented 2 weeks ago

Here is a link to a gzipped tar file containing two folders, one to be used with 2023.2 and the other one to be used with 2024.1.

You just need to start vitis, open the workspace in the matching folder and run "hello_world" (it is already built). The "14 fetched and decoded instructions" message should be printed on the putty window.

After that check, you can rebuild everything : import the HLS hls.app file, build the IP (run C simulation and run C synthesis), export it (run package), in Vivado create a new project, build the design with the exported IP, generate the bitstream, export the hardware, build the platform (back in Vitis IDE), add the hello_world application (updated with the helloworld.c file in the folder), build and run with the board plugged.

Let me know if you succeeded.

[ https://drive.google.com/file/d/11bZoaRcDKo5Qrnpvejhz9cGthTC0fmrk/view?usp=drive_link | https://drive.google.com/file/d/11bZoaRcDKo5Qrnpvejhz9cGthTC0fmrk/view?usp=drive_link ]

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Vendredi 23 Août 2024 15:09:47 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

If I have time, I'll deposit a full tar.gz archive of my fetching_decoding_ip project on my google drive and give you the link tonight (I take a plane early in the morning tomorrow for a 2 weeks vacation, so I hope we'll sort this out before I leave ; I do access my mail when on holiday but I won't have much free time to work though).

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Vendredi 23 Août 2024 15:06:52 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Linux, 20.04

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:44:42 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

OK, I'll try it on 2024 again. Are you on windows or Linux?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: goossens-springer @.> Sent: Friday, August 23, 2024 3:39:47 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I'll try tonight with 2023.2. It worked on 2024.1 for sure !

De: "Avraham Treistman" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Vendredi 23 Août 2024 14:20:51 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I added the initialization to 0. So now I have XFetching_decoding_ip_Get_nb_instruction back. But now the function returns 0! I tried making everything again – still 0. It feels like the *nb_instruction = 0 is generated at the beginning, and the rest of the code is optimized out.

From: goossens-springer @.> Sent: Friday, August 23, 2024 1:33 PM To: goossens-springer/goossens-book-ip-projects @.> Cc: Avi Treistman @.>; Author @.> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello Avi,

You probably forgot to initialize *nb_instruction to 0 before the loop. This why you had no " XFetching_decoding_ip_Get_nb_instruction" function but rather a "XFetching_decoding_ip_Get_nb_instruction_o" one. (in fact I had forgotten the initialization myself !!)

By the way, what is strange is that in later experiments, I use a "nb_cycle" counter similar to the "nb_instruction" one. This counter is computed through an intermediate "nbc" one (like nb_instruction was computed via "nbi"). The number of cycles is computed correctly (through "nbc"), but not "nb_instruction". No explanation.

The "fetching_decoding_ip" function code should be :

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

I also noticed that they removed "XPAR_XFETCHING_DECODING_IP_0_DEVICE_0" !!

Bernard.

De: "Avraham Treistman" @.<mailto:@.>> À: "goossens-springer" @.<mailto:@.>> Cc: "Bernard Goossens" @.<mailto:@.>>, "Comment" @.<mailto:@.>> Envoyé: Vendredi 23 Août 2024 11:53:30 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

I made the changes on a freshly installed copy of 2023.2 on Windows 11 using the Unified version (not classic) I made the following changes to the sources:

  1. Changed fetching_decode_ip.cpp as recommended (removed nbi)
  2. In helloworld.c, I changed line 13 to cfg_ptr = XFetching_decoding_ip_LookupConfig(XPAR_XFETCHING_DECODING_IP_0_BASEADDR);
    • DEVICE_0 is no longer available.
  3. In helloword.c, line 20, (int)XFetching_decoding_ip_Get_nb_instruction_o(&ip));
    • There is no XFetching_decoding_ip_Get_nb_instruction in the xfetching_decode_ip.h file.
  4. I changed the initialization file to ps_init.tcl instead of fetching_decode_ip.tcl.

Unfortunately, the result is 1 fetched and decoded instructions.

Any ideas where this may have gone wrong? Everything else I left as is.

Thanks,

Avi

From: goossens-springer @.<mailto:@.>> Sent: Thursday, August 22, 2024 7:49 AM To: goossens-springer/goossens-book-ip-projects @.<mailto:@.>> Cc: Avi Treistman @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

The good correction is to remove the intermediate "nbi" variable and directly compute on the nb_instruction argument:

void fetching_decoding_ip( unsigned int start_pc, unsigned int code_ram[CODE_RAM_SIZE], unsigned int *nb_instruction){

pragma HLS INTERFACE s_axilite port=start_pc

pragma HLS INTERFACE s_axilite port=code_ram

pragma HLS INTERFACE s_axilite port=nb_instruction

pragma HLS INTERFACE s_axilite port=return

code_address_t pc; instruction_t instruction; bit_t is_running; decoded_instruction_t d_i; pc = start_pc; *nb_instruction = 0; do{

pragma HLS PIPELINE II=3

fetch(pc, code_ram, &instruction); decode(instruction, &d_i); execute(pc, d_i, &pc); statistic_update(nb_instruction); running_cond_update(instruction, &is_running); } while (is_running); }

Probably there is an undesirable optimisation of the synthesizer (set the nb_instruction value with the first iteration nbi value instead of the last iteration one).

bg.

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2303772164, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOVVMPIE5CPNGNINSXLZSVUSPAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTG43TEMJWGQ. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306730899 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5GY7U2IUYQ2KRKOUZITZS4BBVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWG4ZTAOBZHE | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306730899 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306802050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOSBD6HGWY5B6LCFWRTZS4FVXAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHAYDEMBVGA. You are receiving this because you authored the thread.Message ID: @.**@.>>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2306978075 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G7X7DS3IAFVXJXGYM3ZS4SKHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWHE3TQMBXGU | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2306978075 @ github . com>

— Reply to this email directly, view it on GitHubhttps://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2307009642, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABJXFOTK3ZFKTMV3GIX7DN3ZS4URHAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGAYDSNRUGI. You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2307018702 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G5F4FKWW2U4RQLOO2TZS4VDVAVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBXGAYTQNZQGI | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2307018702 @ github . com>

cento commented 1 week ago

It would be helpful to understand how to debug the original issue (incorrect counter) using the waveform. I tried, but I was unable to locate the NBI signal.

goossens-springer commented 1 week ago

Hello,

Finding the signal names is rather tricky (not all the variables become signals and all the signals are not direct variables).

Usually, I look at the scheduling (there is a schedule viewer). As function "statistic_update" is stated as not to be inlined (from the pragma INLINE OFF), you should see it appear on the schdule somewhere in between the last source producer and the first result consumer. With the original "statistic_update" function, it turns out that everything is removed from the schedule (the function does not appear anywhere, as if the synthesizer had decided that its outcome is not consumed, like dead code elimination in a classic compiler). When the function is turned out in a true function (no out variable, but rather a result value), then the function appears in the schedule, at the correct place.

Bernard.

De: "A" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Dimanche 1 Septembre 2024 12:26:06 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

It would be helpful to understand how to debug the original issue (incorrect counter) using the waveform. I tried, but I was unable to locate the NBI signal.

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2323274236 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G6HCCHF2FOEHCGTE43ZULTT5AVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGI3TIMRTGY | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2323274236 @ github . com>

goossens-springer commented 4 days ago

Dear all,

I have added a "2024.1" folder which contains the experiments in the book updated to the Vitis 2024.1 version.

The 2023 versions (both .1 and .2) are buggy. I do not recommend to use them. I have given up to build a "2023.2" folder as I first wanted to.

Up to now, only the single IP experiments have been added (including the multihart design). Within a week, I should add the remaining experiments.

I had to do two changes to the original code :

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Dimanche 1 Septembre 2024 16:54:25 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello,

Finding the signal names is rather tricky (not all the variables become signals and all the signals are not direct variables).

Usually, I look at the scheduling (there is a schedule viewer). As function "statistic_update" is stated as not to be inlined (from the pragma INLINE OFF), you should see it appear on the schdule somewhere in between the last source producer and the first result consumer. With the original "statistic_update" function, it turns out that everything is removed from the schedule (the function does not appear anywhere, as if the synthesizer had decided that its outcome is not consumed, like dead code elimination in a classic compiler). When the function is turned out in a true function (no out variable, but rather a result value), then the function appears in the schedule, at the correct place.

Bernard.

De: "A" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Dimanche 1 Septembre 2024 12:26:06 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

It would be helpful to understand how to debug the original issue (incorrect counter) using the waveform. I tried, but I was unable to locate the NBI signal.

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2323274236 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G6HCCHF2FOEHCGTE43ZULTT5AVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGI3TIMRTGY | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2323274236 @ github . com>

goossens-springer commented 3 days ago

Hello all,

I have added a "multicore_multicycle_2c_ip" folder for the experiments in chapter 12 (two cores).

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Dimanche 8 Septembre 2024 21:17:33 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Dear all,

I have added a "2024.1" folder which contains the experiments in the book updated to the Vitis 2024.1 version.

The 2023 versions (both .1 and .2) are buggy. I do not recommend to use them. I have given up to build a "2023.2" folder as I first wanted to.

Up to now, only the single IP experiments have been added (including the multihart design). Within a week, I should add the remaining experiments.

I had to do two changes to the original code :

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Dimanche 1 Septembre 2024 16:54:25 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello,

Finding the signal names is rather tricky (not all the variables become signals and all the signals are not direct variables).

Usually, I look at the scheduling (there is a schedule viewer). As function "statistic_update" is stated as not to be inlined (from the pragma INLINE OFF), you should see it appear on the schdule somewhere in between the last source producer and the first result consumer. With the original "statistic_update" function, it turns out that everything is removed from the schedule (the function does not appear anywhere, as if the synthesizer had decided that its outcome is not consumed, like dead code elimination in a classic compiler). When the function is turned out in a true function (no out variable, but rather a result value), then the function appears in the schedule, at the correct place.

Bernard.

De: "A" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Dimanche 1 Septembre 2024 12:26:06 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

It would be helpful to understand how to debug the original issue (incorrect counter) using the waveform. I tried, but I was unable to locate the NBI signal.

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2323274236 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G6HCCHF2FOEHCGTE43ZULTT5AVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGI3TIMRTGY | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2323274236 @ github . com>

goossens-springer commented 2 days ago

Hello all,

I have added "multicore_multicycle_4c_ip" and " "multicore_multicycle_8c_ip" folders for the experiments in chapter 12 (four and eight cores).

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Lundi 9 Septembre 2024 21:51:25 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello all,

I have added a "multicore_multicycle_2c_ip" folder for the experiments in chapter 12 (two cores).

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Dimanche 8 Septembre 2024 21:17:33 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Dear all,

I have added a "2024.1" folder which contains the experiments in the book updated to the Vitis 2024.1 version.

The 2023 versions (both .1 and .2) are buggy. I do not recommend to use them. I have given up to build a "2023.2" folder as I first wanted to.

Up to now, only the single IP experiments have been added (including the multihart design). Within a week, I should add the remaining experiments.

I had to do two changes to the original code :

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Dimanche 1 Septembre 2024 16:54:25 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello,

Finding the signal names is rather tricky (not all the variables become signals and all the signals are not direct variables).

Usually, I look at the scheduling (there is a schedule viewer). As function "statistic_update" is stated as not to be inlined (from the pragma INLINE OFF), you should see it appear on the schdule somewhere in between the last source producer and the first result consumer. With the original "statistic_update" function, it turns out that everything is removed from the schedule (the function does not appear anywhere, as if the synthesizer had decided that its outcome is not consumed, like dead code elimination in a classic compiler). When the function is turned out in a true function (no out variable, but rather a result value), then the function appears in the schedule, at the correct place.

Bernard.

De: "A" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Dimanche 1 Septembre 2024 12:26:06 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

It would be helpful to understand how to debug the original issue (incorrect counter) using the waveform. I tried, but I was unable to locate the NBI signal.

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2323274236 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G6HCCHF2FOEHCGTE43ZULTT5AVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGI3TIMRTGY | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2323274236 @ github . com>

goossens-springer commented 1 day ago

Hello all,

I have added the folders for the experiments in chapter 11 to the github.

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Mardi 10 Septembre 2024 22:18:16 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello all,

I have added "multicore_multicycle_4c_ip" and " "multicore_multicycle_8c_ip" folders for the experiments in chapter 12 (four and eight cores).

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Lundi 9 Septembre 2024 21:51:25 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello all,

I have added a "multicore_multicycle_2c_ip" folder for the experiments in chapter 12 (two cores).

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Dimanche 8 Septembre 2024 21:17:33 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Dear all,

I have added a "2024.1" folder which contains the experiments in the book updated to the Vitis 2024.1 version.

The 2023 versions (both .1 and .2) are buggy. I do not recommend to use them. I have given up to build a "2023.2" folder as I first wanted to.

Up to now, only the single IP experiments have been added (including the multihart design). Within a week, I should add the remaining experiments.

I had to do two changes to the original code :

Bernard.

De: "Bernard Goossens" @.> À: "goossens-springer" @.> Envoyé: Dimanche 1 Septembre 2024 16:54:25 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

Hello,

Finding the signal names is rather tricky (not all the variables become signals and all the signals are not direct variables).

Usually, I look at the scheduling (there is a schedule viewer). As function "statistic_update" is stated as not to be inlined (from the pragma INLINE OFF), you should see it appear on the schdule somewhere in between the last source producer and the first result consumer. With the original "statistic_update" function, it turns out that everything is removed from the schedule (the function does not appear anywhere, as if the synthesizer had decided that its outcome is not consumed, like dead code elimination in a classic compiler). When the function is turned out in a true function (no out variable, but rather a result value), then the function appears in the schedule, at the correct place.

Bernard.

De: "A" @.> À: "goossens-springer" @.> Cc: "Bernard Goossens" @.>, "Comment" @.> Envoyé: Dimanche 1 Septembre 2024 12:26:06 Objet: Re: [goossens-springer/goossens-book-ip-projects] fde_ip and fetching_decode_ip do not display correct instruction count (Issue #5)

It would be helpful to understand how to debug the original issue (incorrect counter) using the waveform. I tried, but I was unable to locate the NBI signal.

— Reply to this email directly, [ https://github.com/goossens-springer/goossens-book-ip-projects/issues/5#issuecomment-2323274236 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A2PY5G6HCCHF2FOEHCGTE43ZULTT5AVCNFSM6AAAAABMUDN7YSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGI3TIMRTGY | unsubscribe ] . You are receiving this because you commented. Message ID: <goossens-springer/goossens-book-ip-projects/issues/5/2323274236 @ github . com>