chipsalliance / riscv-dv

Random instruction generator for RISC-V processor verification
Apache License 2.0
997 stars 323 forks source link

How to generate a test with backward branches? #112

Closed agrobman closed 5 years ago

taoliug commented 5 years ago

Please refer to the riscv_rand_instr_test https://github.com/google/riscv-dv/blob/master/yaml/testlist.yaml#L76 You can increase the ratio of loop instructions to generate more backward branch instructions.

The loop instruction is generated by below class, you can enhance it if you want to cover other backward branch scenarios. https://github.com/google/riscv-dv/blob/master/src/riscv_loop_instr.sv

agrobman commented 5 years ago

Thanks, I got this one generated, how do I increase probability of the loops?

From: taoliug notifications@github.com Sent: Wednesday, September 4, 2019 5:48 PM To: google/riscv-dv riscv-dv@noreply.github.com Cc: Alexander Grobman Alexander.Grobman@wdc.com; Author author@noreply.github.com Subject: Re: [google/riscv-dv] How to generate a test with backward branches? (#112)

CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the sender and know that the content is safe.

Please refer to the riscv_rand_instr_test https://github.com/google/riscv-dv/blob/master/yaml/testlist.yaml#L76 You can increase the ratio of loop instructions to generate more backward branch instructions.

The loop instruction is generated by below class, you can enhance it if you want to cover other backward branch scenarios. https://github.com/google/riscv-dv/blob/master/src/riscv_loop_instr.sv

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/google/riscv-dv/issues/112?email_source=notifications&email_token=AK5G545BCC24XTS5LVHQPETQIA3LDA5CNFSM4ITW4NAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD55IARA#issuecomment-528121924, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK5G545IZXVDBO4K4Z4JVBTQIA3LDANCNFSM4ITW4NAA.

taoliug commented 5 years ago

Just increase the number 4 (this is the knob for the possibilities) +directed_instr_1=riscv_loop_instr,4 You can also remove the other directed tests from the command line options if you don't want to include them in your test.

agrobman commented 5 years ago

Thanks a lot again.

From: taoliug notifications@github.com Sent: Wednesday, September 4, 2019 5:53 PM To: google/riscv-dv riscv-dv@noreply.github.com Cc: Alexander Grobman Alexander.Grobman@wdc.com; Author author@noreply.github.com Subject: Re: [google/riscv-dv] How to generate a test with backward branches? (#112)

CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the sender and know that the content is safe.

Just increase the number 4 (this is the knob for the possibilities) +directed_instr_1=riscv_loop_instr,4 You can also remove the other directed tests from the command line options if you don't want to include them in your test.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/google/riscv-dv/issues/112?email_source=notifications&email_token=AK5G546OPIAZUNJYRIY3RCLQIA33PA5CNFSM4ITW4NAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD55IIEQ#issuecomment-528122898, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK5G543EGUSRR3QQU423PL3QIA33PANCNFSM4ITW4NAA.

taoliug commented 5 years ago

BTW, are you using it for swerv core? I have done some work locally, the ISS/RTL sim comparison part as the tracer from swerv core doesn't have the rd value information. Let me know if you need help on this.

agrobman commented 5 years ago

Yes, we want to use riscv_dv as a 2nd source test generator for next generation of the swerv cores. I’m not sure what did you mean by “rd value information”. Internally (in house) we are comparing RTL CPU state with ISS for every executed instruction ..

From: taoliug notifications@github.com Sent: Wednesday, September 4, 2019 5:55 PM To: google/riscv-dv riscv-dv@noreply.github.com Cc: Alexander Grobman Alexander.Grobman@wdc.com; Author author@noreply.github.com Subject: Re: [google/riscv-dv] How to generate a test with backward branches? (#112)

CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the sender and know that the content is safe.

BTW, are you using it for swerv core? I have done some work locally, the ISS/RTL sim comparison part as the tracer from swerv core doesn't have the rd value information. Let me know if you need help on this.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/google/riscv-dv/issues/112?email_source=notifications&email_token=AK5G545CRXH2TWOSYP54NI3QIA4FZA5CNFSM4ITW4NAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD55IM2Q#issuecomment-528123498, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK5G5445DS7M5UQRB72IPITQIA4FZANCNFSM4ITW4NAA.

taoliug commented 5 years ago

I mean the external trace interface doesn't provide the result of the instruction. Maybe there'e some other way to get the complete trace info? https://github.com/westerndigitalcorporation/swerv_eh1/blob/master/design/swerv.sv#L34

agrobman commented 5 years ago

I need to talk to management. To get full CPU state you need to integrate our UVM tracer/whisper(ISS).

From: taoliug notifications@github.com Sent: Wednesday, September 4, 2019 6:06 PM To: google/riscv-dv riscv-dv@noreply.github.com Cc: Alexander Grobman Alexander.Grobman@wdc.com; Author author@noreply.github.com Subject: Re: [google/riscv-dv] How to generate a test with backward branches? (#112)

CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the sender and know that the content is safe.

I mean the external trace interface doesn't provide the result of the instruction. Maybe there'e some other way to get the complete trace info? https://github.com/westerndigitalcorporation/swerv_eh1/blob/master/design/swerv.sv#L34

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/google/riscv-dv/issues/112?email_source=notifications&email_token=AK5G544DEJGY3VWVH7OEEKTQIA5LZA5CNFSM4ITW4NAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD55I6YI#issuecomment-528125793, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK5G546RFVIIAVJMTLIUIJ3QIA5LZANCNFSM4ITW4NAA.

taoliug commented 5 years ago

Sure, let me close this issue for now, we can discuss with a separate thread. I actually have a plan to open-source an integrated TB with swerv-eh1. Adding whisper(ISS) should be straightforward, but I failed to install in my local (got core dump). If you get it work, it will be great to add this support in the riscv-dv repository. Let me if you question with ISS integration.

agrobman commented 5 years ago

Our ISS guy is going to vacation soon, I’ll ask if he can help you with whisper .. Still whisper need to be integrated to TB …

From: taoliug notifications@github.com Sent: Wednesday, September 4, 2019 6:20 PM To: google/riscv-dv riscv-dv@noreply.github.com Cc: Alexander Grobman Alexander.Grobman@wdc.com; Author author@noreply.github.com Subject: Re: [google/riscv-dv] How to generate a test with backward branches? (#112)

CAUTION: This email originated from outside of Western Digital. Do not click on links or open attachments unless you recognize the sender and know that the content is safe.

Sure, let me close this issue for now, we can discuss with a separate thread. I actually have a plan to open-source an integrated TB with swerv-eh1. Adding whisper(ISS) should be straightforward, but I failed to install in my local (got core dump). If you get it work, it will be great to add this support in the riscv-dv repository. Let me if you question with ISS integration.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/google/riscv-dv/issues/112?email_source=notifications&email_token=AK5G545HCA7MI4VGZ6Q4RRLQIA7A3A5CNFSM4ITW4NAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD55JW5A#issuecomment-528128884, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AK5G546NTUOZCOX4DDJSAWLQIA7A3ANCNFSM4ITW4NAA.