Files
TBgen_App/autoline/__pycache__/TB2_syncheck.cpython-312.pyc

126 lines
26 KiB
Plaintext
Raw Normal View History

2026-03-30 16:46:48 +08:00
<EFBFBD>
P<>YiXO<00><00><><00>dZddlZddlZddlZddlZddlZ ddl
m Z ddlm Z ddlmZddlmZmZddlmZmZdd d
<EFBFBD>Zed <00>d ed <00><01>ZdezZdZdZdZGd<12>d<13>Zy)z<>
Description : This is the TB syntactic checking stage in the autoline (previously named as TaskTBsim in autoline.py)
Author : Ruidi Qiu (r.qiu@tum.de)
Time : 2024/7/24 11:24:31
LastEdited : 2024/8/23 15:53:15
<EFBFBD>N)<01>Config)<01>
autologger)<01>log_localprefix)<02>
get_script<EFBFBD>
BaseScript)<02>Timer<65>get_timez
```verilogz```)<02>tb_start<72>tb_endr
zF
`timescale 1ns / 1ps
(more verilog testbench code here...)
endmodule
r a1please fix the verilog testbench code below according to the error message below. please directly give me the corrected verilog testbench codes.
Attention: never remove the irrelevant codes!!!
your verilog testbench should be like:
%s
please only reply the full code modified. NEVER remove other irrelevant codes!!!
The testbench I give you is the one with error. To be convienient, each of the line begins with a line number. The line number also appears at the error message. You should use the line number to locate the error with the help of error message.
z<EFBFBD> please directly give me the corrected verilog codes, no other words needed. Your verilog codes should start with [```verilog] and end with [```].a<>please fix the python code below according to the error message below. please directly give me the corrected python codes.
Attention: never remove the irrelevant codes!!!
please only reply the full code modified. NEVER remove other irrelevant codes!!!
The python code I give you is the one with error. To be convienient, each of the line begins with a line number. The line number also appears at the error message. You should use the line number to locate the error with the help of error message.
z<EFBFBD> please directly give me the corrected python codes, no other words needed. Your python codes should start with [```python] and end with [```].c
<00>N<00>eZdZdZdededededef
d<07>Zed<08>d <09><00>Zd
<EFBFBD>Z d <0B>Z
d <0C>Z d <0A>Z d<0E>Z d<0F>Zd<10>Zd<11>Zd<12>Zd<13>Zdedefd<16>Zed&dedefd<19><05>Zed<1A><00>Zed<1B><00>Zed<1C><00>Zed<1D><00>Zed<1E><00>Zed<1F><00>Zd <20>Zedefd!<21><04>Z edefd"<22><04>Z!d#<23>Z"d$<24>Z#y%)'<27> TaskTBsima`
#### input:
- ivcode_path:
- the path of iverilog dir (xxx/TB_gen/), will contain all verilog files. generated .vvp will also be saved here
#### output:
- dict of the simulation result
- "sim_pass" : bool (whether the simulation is successful. This is only the necessary condition of the correctness of the testbench)
- "debug_iter" : int (the number of debug iterations)
- "sim_out" : str (the output of the simulation)
- "sim_err" : str (the error of the simulation)
- "TB_gen_debugged" : str or None (the testbench code after debug)
#### iverilog_path:
- the path of iverilog dir, will contain all verilog files. generated .vvp will also be saved here
#### task_id:
- the name of the problem, will be used as the name of generated files
file structure:
- original
- task_id.v
- task_id_tb.v
- task_id_vlist.txt
- task_id.vvp
- debug_1
- task_id.v
- task_id_tb.v
- task_id_vlist.txt
- task_id.vvp
- debug_2
- ...
<20>TBgen<65>TB_code<64> module_header<65>task_dir<69>task_idc<00><><00>||_||_||_|jd<01>r|n|dz|_||_||_|jjd<01>r |jn|jdz|_|dz|_ |jjj|_ |jjj|_|jj |_d|_d|_d|_d|_d|_|jj.|_d|_|j0rbd|_|jj6|_|jjj8|_|jj<|_d|_d|_ d|_!d|_"d|_#d|_$d|_%ddd<07>|_&y)N<>/z
endmodule
rF<>g)<02>prompt<70>
completion)'r<00> TB_code_nowr<00>endswithrr<00>config<69> TB_code_dir<69> working_dir<69>DUT_code<64>autoline<6E>debug<75>max<61>debug_iter_max<61>reboot<6F>debug_iter_to_reboot<6F>timeout<75> proc_timeout<75>debug_iter_iv_now<6F>debug_iter_after_reboot_iv<69>debug_iter_py_now<6F>debug_iter_after_reboot_py<70> reboot_both<74> Pychecker_en<65> pychecker_en<65> PY_code_now<6F> TBout_content<6E>Pychecker_code<64> py_rollback<63>py_fail_reboot_both_iter<65>py_debug_focus<75>sim_pass<73>py_pass<73>
Eval0_pass<EFBFBD> iverilog_info<66>reboot_both_times<65>iv_runing_time<6D>py_runing_time<6D>tokens)<07>selfrrrrrrs <20>;/home/zhang/CorrectBench/TBgen_App/autoline/TB2_syncheck.py<70>__init__zTaskTBsim.__init__Ts<><00><00><1A><04>
<EFBFBD>"<22><04><18>*<2A><04><1A>$,<2C>$5<>$5<>c<EFBFBD>$:<3A><08><08>3<EFBFBD><0E><04> <0A><1E><04> <0C><1C><04> <0B>05<30>0A<30>0A<30>0J<30>0J<30>3<EFBFBD>0O<30>5<EFBFBD>,<2C>,<2C>UZ<55>Uf<55>Uf<55>il<69>Ul<55><04><18>%<25>(9<>9<><04> <0A>$<24>o<EFBFBD>o<EFBFBD>3<>3<>7<>7<><04><1B>$*<2A>O<EFBFBD>O<EFBFBD>$9<>$9<>$@<40>$@<40><04>!<21>"<22>O<EFBFBD>O<EFBFBD>3<>3<><04><19>!"<22><04><1E>*+<2B><04>'<27>!"<22><04><1E>*+<2B><04>'<27> <20><04><18>!<21>J<EFBFBD>J<EFBFBD>3<>3<><04><19><1D><04><18> <0F> <1C> <1C>!#<23>D<EFBFBD> <1E>#<23>z<EFBFBD>z<EFBFBD>8<>8<>D<EFBFBD> <1C>,2<>O<EFBFBD>O<EFBFBD>,A<>,A<>,M<>,M<>D<EFBFBD> )<29>"&<26>*<2A>*<2A>";<3B>";<3B>D<EFBFBD> <1F><1D><04> <0A><1C><04> <0C><1F><04><0F>!<21><04><1A>!"<22><04><1E>!<21><04><1B>!<21><04><1B>!"<22>!<21>4<><04> <0B><00>TBsimc<00><><00>|js"|j<00>|j|_nud}|sR|j<00>|jr|j <00>|j
sd}nd}d|_t d<03><00>|s<01>R|jxr |j|_tjd|jz<00>y)NFTz9TBsim: iverilog failed, python simulation is not allowed.zTBsim finished : %s!)
r,<00> run_iverilogr3r5<00>
run_pythonr*<00>
ValueErrorr4<00>logger<65>info)r;<00>exit_ens r<<00>runz TaskTBsim.runys<><00><00><13> <20> <20> <10> <1D> <1D> <1F>"<22>m<EFBFBD>m<EFBFBD>D<EFBFBD>O<EFBFBD><1B>G<EFBFBD><1E><14>!<21>!<21>#<23><17>=<3D>=<3D><18>O<EFBFBD>O<EFBFBD>%<25><1F>+<2B>+<2B>"&<26><07>"<22>G<EFBFBD>&+<2B>D<EFBFBD>O<EFBFBD>$<24>%`<60>a<>a<><1F>#<23>m<EFBFBD>m<EFBFBD><<3C><04> <0C> <0C>D<EFBFBD>O<EFBFBD><0E> <0B> <0B>*<2A>D<EFBFBD>O<EFBFBD>O<EFBFBD><<3C>=r>c<00><><00>|js$|j<00>|jd|_|j|j
kr<>|js<>|xjdz c_|j |jkr&|xj dz c_|j<00>n|j<00>|jd|_d|_|j|j
kr |js<01><>|jr"tjd|j
z<00>|jrtjd<05>n"tjd|j
z<00>|j<00>y)z.
- the main function of TBsim
r<00>Fz^iverilog compilation (reboot from python) : failed! iverilog exceeded max debug iteration (%s)ziverilog compilation : passed!z@iverilog compilation : failed! exceeded max debug iteration (%s)N) r*<00>_save_code_run_iverilogr6r3r&r!r'r#<00> _debug_iv<69>
_reboot_ivrDrE<00> clean_vcd<63>r;s r<rAzTaskTBsim.run_iverilog<6F>s0<00><00><14><1F><1F> <10> (<28> (<28> *<2A> <20>.<2E>.<2E>q<EFBFBD>1<>D<EFBFBD>M<EFBFBD><13>%<25>%<25><04>(;<3B>(;<3B>;<3B>d<EFBFBD>m<EFBFBD>m<EFBFBD> <10> "<22> "<22>a<EFBFBD> '<27> "<22><13>.<2E>.<2E><14>1J<31>1J<31>J<><14>/<2F>/<2F>1<EFBFBD>4<>/<2F><14><0E><0E> <20><14><0F><0F>!<21> <20>.<2E>.<2E>q<EFBFBD>1<>D<EFBFBD>M<EFBFBD>$<24>D<EFBFBD> <1C><14>%<25>%<25><04>(;<3B>(;<3B>;<3B>d<EFBFBD>m<EFBFBD>m<EFBFBD> <10> <1B> <1B> <12>K<EFBFBD>K<EFBFBD>x<>z~<7E>{N<02>{N<02>O<02> P<02> <0F>=<3D>=<3D> <12>K<EFBFBD>K<EFBFBD>8<> 9<> <12>K<EFBFBD>K<EFBFBD>Z<>\`<60>\o<>\o<>p<> q<> <0A><0E><0E>r>c<00><00>t|jd<01>5}|j<00>|_ddd<00>d|_d}|j <00>|j |jkr<>|jds<>|jds||jk\rd|_
n<>|dz }|xj dz c_|j|jkr&|xjdz c_|j<00>n|j<00>|j |jkr|jds<01><>|jr5d|_d|_|j|_t#j$d<06>nU|jdrd|_t#j$d<07>n)d|_t#j$d|jz<00>|jd<00>|jdd nd
|_|jd |_y#1swY<00><01><>xYw) N<>rrTrIFz@python simulation : failed! will reboot both iverilog and pythonzpython simulation : passed!z=python simulation : failed! exceeded max debug iteration (%s)<29>outr<00><><EFBFBD><EFBFBD><EFBFBD>)<15>open<65>
TBout_path<EFBFBD>readr.r)<00>_save_code_run_pythonr(r!<00> python_infor1r*r#<00> _debug_py<70>
_reboot_pyr4r3r'rDrE<00>py_out<75>py_err)r;<00>fr0s r<rBzTaskTBsim.run_python<6F>s<><00><00> <11>$<24>/<2F>/<2F>3<EFBFBD> '<27> *<2A>1<EFBFBD>!"<22><16><16><18>D<EFBFBD> <1E> *<2A>*+<2B><04>'<27><17> <0B> <0C>"<22>"<22>$<24><13>%<25>%<25><04>(;<3B>(;<3B>;<3B>d<EFBFBD>FV<46>FV<46>WX<57>FY<46><18>$<24>$<24>Q<EFBFBD>'<27>k<EFBFBD>T<EFBFBD>=Z<>=Z<>.Z<>#'<27><04> <20><15> <17>1<EFBFBD> <1C>K<EFBFBD> <10> "<22> "<22>a<EFBFBD> '<27> "<22><13>.<2E>.<2E><14>1J<31>1J<31>J<><14>/<2F>/<2F>1<EFBFBD>4<>/<2F><14><0E><0E> <20><14><0F><0F>!<21><14>%<25>%<25><04>(;<3B>(;<3B>;<3B>d<EFBFBD>FV<46>FV<46>WX<57>FY<46> <10> <1B> <1B> <20>D<EFBFBD>L<EFBFBD>!<21>D<EFBFBD>M<EFBFBD>.2<EFBFBD>.G<>.G<>D<EFBFBD> +<2B> <12>K<EFBFBD>K<EFBFBD>Z<> [<5B> <11> <1D> <1D>a<EFBFBD> <20><1F>D<EFBFBD>L<EFBFBD> <12>K<EFBFBD>K<EFBFBD>5<> 6<> <20>D<EFBFBD>L<EFBFBD> <12>K<EFBFBD>K<EFBFBD>W<>Y]<5D>Yl<59>Yl<59>m<> n<>48<34>4D<34>4D<34>Q<EFBFBD>4G<34>4S<34>d<EFBFBD>&<26>&<26>q<EFBFBD>)<29>%<25>0<>Y[<5B><04> <0B><1A>&<26>&<26>r<EFBFBD>*<2A><04> <0B>A *<2A> *<2A>s <00>H<03>H c<00><><00>td<01><02>5}tjd|jz<00>|jd|j
zz|_tj|j d<05><06>|j<00>}d|d<08>g}tj||jjj|jjj<00>\}}|d }tj |d
<EFBFBD>d |_|j%|j"<00>|_|j'<00>ddd<00>tj|j)d <0C><00>d t+j,d<0E><00>d<0F><04>|j.dxxddz cc<|j.dxx|ddz cc<t1j2|j dz<00>y#1swY<00><>xYw)NF<4E><01>print_enz9iverilog simulation failed! Debuging... (debug_iter = %s)<29> debug_%s/T<><01>exist_ok<6F>user<65><02>role<6C>content<6E>messages<65>verilogrR<00>ivz: verilog DEBUG finished (<28><00>s used)r<00>usage<67> prompt_tokensr<00>completion_tokens<6E>debug_messages.txt)rrDrEr&r<00>total_debug_iter_nowr<00>os<6F>makedirs<72>_debug_prompt_gen_iv<69>llm<6C>llm_callr<00>gpt<70>model<65>key_path<74> extract_coder<00> del_linemarkrJ<00>debug_iter_info<66>round<6E>intervalr:<00>ls<6C>save_messages_to_txt<78>r;<00>
debug_time<EFBFBD> debug_prompt<70> debug_message<67> gpt_responserEs r<rKzTaskTBsim._debug_iv<69>s<><00><00> <12>E<EFBFBD> "<22>
+<2B>j<EFBFBD> <12>K<EFBFBD>K<EFBFBD>S<>UY<55>Uk<55>Uk<55>l<> m<>#<23>}<7D>}<7D>{<7B>d<EFBFBD>>W<>>W<>/X<>X<>D<EFBFBD> <1C> <0E>K<EFBFBD>K<EFBFBD><04>(<28>(<28>4<EFBFBD> 8<><1F>4<>4<>6<>L<EFBFBD>&,<2C><1C>F<>G<>M<EFBFBD>!$<24><1C><1C>m<EFBFBD>T<EFBFBD>[<5B>[<5B>_<EFBFBD>_<EFBFBD>=R<>=R<>TX<54>T_<54>T_<54>Tc<54>Tc<54>Tl<54>Tl<54>!m<> <1E>L<EFBFBD>$<24> <20><1A>,<2C>M<EFBFBD>"<22>/<2F>/<2F> <0C>i<EFBFBD>H<><12>L<>D<EFBFBD> <1C>#<23>0<>0<><14>1A<31>1A<31>B<>D<EFBFBD> <1C> <10> (<28> (<28> *<2A>
+<2B> <0F> <0B> <0B>t<EFBFBD>?S<>?S<>TX<54>?Y<>[`<60>ak<61>at<61>at<61>vw<76>[x<>y<>z<> <0C> <0B> <0B>H<EFBFBD><1D><14>g<EFBFBD><1D><EFBFBD>!?<3F>?<3F><1D> <0C> <0B> <0B>L<EFBFBD>!<21>T<EFBFBD>'<27>]<5D>3F<33>%G<>G<>!<21>
<EFBFBD><1F><1F> <0A>t<EFBFBD>/?<3F>/?<3F>@T<>/T<>U<>
+<2B>
+<2B>s <00>D$G<03>Gc<00><<00>td<01><02>5}tjd|jz<00>|jd|j
zz|_tj|j d<05><06>|jj|j d<07><08>|jj|_ |j<00>ddd<00>tj|jd <09><00>d
tj d <0B><00>d <0C><04>d |_y#1swY<00>OxYw)NFr^z:iverilog simulation failed! Rebooting... (debug_iter = %s)<29>debug_%s_reboot/Tra<00>TB<54><01> reboot_moderiz: verilog REBOOT finished (rjrkr)rrDrEr&rrprrqrrr<00>
run_rebootrrrJr{r|r}r'<00>r;<00> reboot_times r<rLzTaskTBsim._reboot_iv<69>s<><00><00> <12>U<EFBFBD> #<23> +<2B>{<7B> <12>K<EFBFBD>K<EFBFBD>T<>VZ<56>Vl<56>Vl<56>m<> n<>#<23>}<7D>}<7D>/A<>T<EFBFBD>E^<5E>E^<5E>/_<>_<>D<EFBFBD> <1C> <0E>K<EFBFBD>K<EFBFBD><04>(<28>(<28>4<EFBFBD> 8<> <10>J<EFBFBD>J<EFBFBD> !<21> !<21>$<24>"2<>"2<><04> !<21> E<>#<23>z<EFBFBD>z<EFBFBD>1<>1<>D<EFBFBD> <1C> <10> (<28> (<28> *<2A>  +<2B> <0F> <0B> <0B><04>@T<>@T<>UY<55>@Z<>\a<>bm<62>bv<62>bv<62>xy<78>\z<>{<7B>|<7C>+,<2C><04>'<27> +<2B> +<2B><> <00>B7D<03>Dc<00><00>td<01><02>5}tjd|jz<00>|jd|j
zz|_tj|j d<05><06>|j<00>}d|d<08>g}tj||jjj|jjj<00>\}}|d }tj |d
<EFBFBD>d |_|j%|j"<00>|_|j&r"|j)|j"d<01> <0C>|_|j+<00>ddd<00>tj|j-d <0A><00>dt/j0d<0F><00>d<10><04>|j2dxxddz cc<|j2dxx|ddz cc<t5j6|j dz<00>y#1swY<00><>xYw)NFr^z?python compilation failed! Debuging python... (debug_iter = %s)r`Trarcrdrg<00>pythonrR<00><01>before<72>pyz: python DEBUG finished (rjrkrrlrmrrnro)rrDrEr(rrprrqrr<00>_debug_prompt_gen_pyrtrurrvrwrxryr-rzr2<00> _py_focusrVr{r|r}r:r~rr<>s r<rXzTaskTBsim._debug_py<70>s<><00><00> <12>E<EFBFBD> "<22> )<29>j<EFBFBD> <12>K<EFBFBD>K<EFBFBD>Y<>[_<>[q<>[q<>r<> s<>#<23>}<7D>}<7D>{<7B>d<EFBFBD>>W<>>W<>/X<>X<>D<EFBFBD> <1C> <0E>K<EFBFBD>K<EFBFBD><04>(<28>(<28>4<EFBFBD> 8<><1F>4<>4<>6<>L<EFBFBD>&,<2C><1C>F<>G<>M<EFBFBD>!$<24><1C><1C>m<EFBFBD>T<EFBFBD>[<5B>[<5B>_<EFBFBD>_<EFBFBD>=R<>=R<>TX<54>T_<54>T_<54>Tc<54>Tc<54>Tl<54>Tl<54>!m<> <1E>L<EFBFBD>$<24> <20><1A>,<2C>M<EFBFBD>"<22>/<2F>/<2F> <0C>h<EFBFBD>G<><02>K<>D<EFBFBD> <1C>#<23>0<>0<><14>1A<31>1A<31>B<>D<EFBFBD> <1C><13>"<22>"<22>#'<27>><3E>><3E>$<24>2B<32>2B<32>5<EFBFBD>><3E>#Q<><04> <20> <10> &<26> &<26> (<28> )<29> <0F> <0B> <0B>d<EFBFBD>>R<>>R<>SW<53>>X<>Z_<5A>`j<>`s<>`s<>uv<75>Zw<5A>x<>y<> <0C> <0B> <0B>H<EFBFBD><1D><14>g<EFBFBD><1D><EFBFBD>!?<3F>?<3F><1D> <0C> <0B> <0B>L<EFBFBD>!<21>T<EFBFBD>'<27>]<5D>3F<33>%G<>G<>!<21>
<EFBFBD><1F><1F> <0A>t<EFBFBD>/?<3F>/?<3F>@T<>/T<>U<># )<29> )<29>s <00>EH<03>H c<00><<00>td<01><02>5}tjd|jz<00>|jd|j
zz|_tj|j d<05><06>|jj|j d<07><08>|jj|_ |j<00>ddd<00>tj|jd <09><00>d
tj d <0B><00>d <0C><04>d |_y#1swY<00>OxYw)NFr^z9python compilation failed! Rebooting... (debug_iter = %s)r<>Tra<00>PYr<59>r<>z: python REBOOT finished (rjrkr)rrDrEr(rrprrqrrrr<>r/r-rVr{r|r}r)r<>s r<rYzTaskTBsim._reboot_pys<><00><00> <12>U<EFBFBD> #<23> )<29>{<7B> <12>K<EFBFBD>K<EFBFBD>S<>UY<55>Uk<55>Uk<55>l<> m<>#<23>}<7D>}<7D>/A<>T<EFBFBD>E^<5E>E^<5E>/_<>_<>D<EFBFBD> <1C> <0E>K<EFBFBD>K<EFBFBD><04>(<28>(<28>4<EFBFBD> 8<> <10>J<EFBFBD>J<EFBFBD> !<21> !<21>$<24>"2<>"2<><04> !<21> E<>#<23>z<EFBFBD>z<EFBFBD>8<>8<>D<EFBFBD> <1C> <10> &<26> &<26> (<28>  )<29> <0F> <0B> <0B>t<EFBFBD>?S<>?S<>TX<54>?Y<>[`<60>al<61>au<61>au<61>wx<77>[y<>z<>{<7B>+,<2C><04>'<27> )<29> )<29>r<EFBFBD>c<00><><00>t|jd<01>5}|j|j<00>ddd<00>t|jd<01>5}|j|j
<00>ddd<00>t d<02><03>5}tj|jd|j<00><05>|_ ddd<00>tjd<06>|_|jd|_d|jvrYt j"j%|j&<00>rt!j(|j&<00>|j+<00>yy#1swY<00><01>!xYw#1swY<00><>xYw#1swY<00><>xYw) N<>wFr^T)<02>silentr$rjrR<00>program is timeout)rS<00>TB_path<74>writer<00>DUT_pathrrri<00>iverilog_call_and_saverr%r6r|r}r8<00>error_message_nowrq<00>path<74>existsrT<00>remove<76> clean_vvp)r;r\<00> iverilog_times r<rJz!TaskTBsim._save_code_run_iverilogs!<00><00> <11>$<24>,<2C>,<2C><03> $<24> &<26><01> <0A>G<EFBFBD>G<EFBFBD>D<EFBFBD>$<24>$<24> %<25> &<26> <11>$<24>-<2D>-<2D><13> %<25> #<23><11> <0A>G<EFBFBD>G<EFBFBD>D<EFBFBD>M<EFBFBD>M<EFBFBD> "<22> #<23> <12>E<EFBFBD> "<22> u<01>m<EFBFBD>!#<23>!:<3A>!:<3A>4<EFBFBD>;K<>;K<>TX<54>bf<62>bs<62>bs<62>!t<>D<EFBFBD> <1E> u<01>#<23>M<EFBFBD>$:<3A>$:<3A>A<EFBFBD>><3E><04><1B>!%<25>!3<>!3<>B<EFBFBD>!7<><04><1E> <1F>4<EFBFBD>#9<>#9<> 9<><12>w<EFBFBD>w<EFBFBD>~<7E>~<7E>d<EFBFBD>o<EFBFBD>o<EFBFBD>.<2E><12> <09> <09>$<24>/<2F>/<2F>*<2A> <10>N<EFBFBD>N<EFBFBD> <1C> :<3A> &<26> &<26><> #<23> #<23><> u<01> u<01>s#<00>E<03>E<03>2E+<03>E<07>E(<07>+E4c<00><00>t|jd<01>5}|j|j<00>ddd<00>t|jd<01>5}|j|j
<00>ddd<00>t d<02><03>5}tj|jd|j<00><05>|_
ddd<00>tjd<06>|_ |jd|_y#1swY<00><>xYw#1swY<00><>xYw#1swY<00>QxYw)Nr<4E>Fr^T)<03>pypathr<68>r$rjrR)rS<00>PY_pathr<68>r-rTr.rr<><00>python_call_and_saver%rWr|r}r9r<>)r;r\<00> python_times r<rVzTaskTBsim._save_code_run_python s<><00><00> <11>$<24>,<2C>,<2C><03> $<24> &<26><01> <0A>G<EFBFBD>G<EFBFBD>D<EFBFBD>$<24>$<24> %<25> &<26> <11>$<24>/<2F>/<2F>3<EFBFBD> '<27> (<28>1<EFBFBD> <0A>G<EFBFBD>G<EFBFBD>D<EFBFBD>&<26>&<26> '<27> (<28> <12>E<EFBFBD> "<22> t<01>k<EFBFBD>!<21>6<>6<>d<EFBFBD>l<EFBFBD>l<EFBFBD>SW<53>ae<61>ar<61>ar<61>s<>D<EFBFBD> <1C> t<01>#<23>K<EFBFBD>$8<>$8<>!<21><<3C><04><1B>!%<25>!1<>!1<>"<22>!5<><04><1E> &<26> &<26><> (<28> (<28><> t<01> t<01>s#<00>C+<03>C7<03>2D<03>+C4<07>7D<07>D c<00>p<00>tdz|j|j<00>zdz|jz}|S)Nz!
previous testbench with error:
<EFBFBD>
compiling error message:
)<04>DEBUG_TEMPLATE<54> add_linemarkrr<>)r;r<>s r<rszTaskTBsim._debug_prompt_gen_iv*sS<00><00>%<25>(M<>M<>PT<50>Pa<50>Pa<50>bf<62>br<62>br<62>Ps<50>s<>wV<02>V<02>Y]<02>Yo<02>Yo<02>o<02> <0C><1B>r>c<00>2<00>|jr|j|jd<01><02>}n |j}d|jvr |j |j<00>|_t
dz|j |<01>zdz|jztz}|S)NTr<54>r<>z#
previous python code with error:
r<EFBFBD>)r2r<>r-r<><00>_py_error_message_simplify<66>DEBUG_TEMPLATE_PYr<59><00>DEBUG_FINAL_INSTR_PY)r;<00>py_coder<65>s r<r<>zTaskTBsim._debug_prompt_gen_py.s<><00><00> <0F> <1E> <1E><1A>n<EFBFBD>n<EFBFBD>T<EFBFBD>%5<>%5<>d<EFBFBD>n<EFBFBD>C<>G<EFBFBD><1A>&<26>&<26>G<EFBFBD>$<24><04>(><3E>(><3E>><3E>%)<29>%D<>%D<>T<EFBFBD>E[<5B>E[<5B>%\<5C>D<EFBFBD> "<22>(<28>+R<>R<>UY<55>Uf<55>Uf<55>gn<67>Uo<55>o<>sR<02>R<02>UY<02>Uk<02>Uk<02>k<02>nB<03>B<03> <0C><1B>r><00>coder<65>c<00><><00>d}d}|rI||vr|n|}||vr |}d|_|S|j|<05>d}||j|<05>dz|_|S||jzS)z<>
- code: the code under debug / after debug
- before: True, if before debug, will split the code; False, if after debug, will restore the code
zQdef check_dut(vectors_in):
golden_dut = GoldenDUT()
failed_scenarios = []z
def SignalTxt_to_dictlistrrrI)<02>py_code_nofocus<75>split)r;r<>r<><00> KEY_WORDs_1<5F> KEY_WORDs_2<5F> key_words<64> py_code_focuss r<r<>zTaskTBsim._py_focus8s<><00><00> l<01> <0B>3<> <0B> <11>'2<>d<EFBFBD>':<3A> <0B> <0B>I<EFBFBD><18><04>$<24> $<24> <0A>')<29><04>$<24>!<21> <20>!%<25>
<EFBFBD>
<EFBFBD>9<EFBFBD> 5<>a<EFBFBD> 8<> <0A>'0<>4<EFBFBD>:<3A>:<3A>i<EFBFBD>3H<33><11>3K<33>'K<><04>$<24> <20> <20><17>$<24>.<2E>.<2E>.<2E> .r><00> error_message<67> error_depthc<00><><00>|jd<01>}d}t|<02>D]}|dz|z}d|vs<01>|dz}|dk(s<01>|S|S)z<>
- extract the key point of python error message
- error_depth: how many (how deep, from bottom to top) error messages to extract
<20>
r<00>FilerIr)r<><00>reversed)r<>r<><00> msg_lines<65>msg_out<75>lines r<r<>z$TaskTBsim._py_error_message_simplifyLsc<00><00> "<22>'<27>'<27><04>-<2D> <09><14><07><1C>Y<EFBFBD>'<27> <1A>D<EFBFBD><1A>T<EFBFBD>k<EFBFBD>G<EFBFBD>+<2B>G<EFBFBD><15><14>~<7E><1B>q<EFBFBD> <20> <0B><1E>!<21>#<23><19><16><0E>  <1A> <17>r>c<00>j<00>|j|jk\xs|j|jk\S<00>N)r&r!r(rNs r<<00>exceed_max_debugzTaskTBsim.exceed_max_debug\s0<00><00><14>&<26>&<26>$<24>*=<3D>*=<3D>=<3D>q<>4<EFBFBD>CY<43>CY<43>]a<>]p<>]p<>Cp<43>qr>c<00>4<00>|j|jzSr<>)r&r(rNs r<rpzTaskTBsim.total_debug_iter_now`s<00><00><13>%<25>%<25><04>(><3E>(><3E>><3E>>r>c<00>:<00>|j|jzdzS)Nz_tb.v<>rrrNs r<r<>zTaskTBsim.TB_pathds<00><00><13><1F><1F>$<24>,<2C>,<2C>.<2E><17>8<>8r>c<00>:<00>|j|jzdzS)Nz.vr<76>rNs r<r<>zTaskTBsim.DUT_pathhs<00><00><13><1F><1F>$<24>,<2C>,<2C>.<2E><14>5<>5r>c<00>:<00>|j|jzdzS)Nz_tb.pyr<79>rNs r<r<>zTaskTBsim.PY_pathls<00><00><13><1F><1F>$<24>,<2C>,<2C>.<2E><18>9<>9r>c<00> <00>|jdzS)Nz TBout.txt)rrNs r<rTzTaskTBsim.TBout_pathps<00><00><13><1F><1F>+<2B>-<2D>-r>c<00>J<00>|jr}|dk(r4d|j|j|j|jdzfzS|dk(r4d|j|j|j|jdzfzSt d<06><00>d|j|jfzS)z2return debug iter info string. Type: "iv" or "py" riz#verilog iter - %d/%d, total - %d/%drjr<>z"python tier - %d/%d, total - %d/%dz<TaskTBsim.debug_iter_info(type): type should be 'iv' or 'py'zdebug iter %d/%d)r,r&r!rpr(rC)r;<00>types r<r{zTaskTBsim.debug_iter_infots<><00><00> <0F> <1C> <1C><13>t<EFBFBD>|<7C><<3C>d<EFBFBD>>T<>>T<>VZ<56>Vi<56>Vi<56>ko<6B>lE<02>lE<02>GK<02>GZ<02>GZ<02>[\<02>G\<02>>]<02>]<02>]<02><15><14><1C>;<3B>T<EFBFBD>=S<>=S<>UY<55>Uh<55>Uh<55>jn<6A>kD<02>kD<02>FJ<02>FY<02>FY<02>Z[<02>F[<02>=\<02>\<02>\<02> <20>!_<>`<60>`<60>&<26>t<EFBFBD>'=<3D>'=<3D>t<EFBFBD>?R<>?R<>&S<>S<> Sr>c<00><><00>|jd<01>}t|<00>D<00><01>cgc]\}}t|dz<00>dz|z<00><02>}}}dj|<00>Scc}}w)zIadd the line mark (1., 2., ...) to the code at the beginning of each liner<65>rI<00>. )r<><00> enumerate<74>str<74>join)r<><00>ir<69>s r<r<>zTaskTBsim.add_linemark<72>sR<00><00><14>z<EFBFBD>z<EFBFBD>$<24><1F><04>6?<3F><04>o<EFBFBD>F<>7<EFBFBD>1<EFBFBD>d<EFBFBD><03>A<EFBFBD>a<EFBFBD>C<EFBFBD><08>4<EFBFBD><0F>$<24>&<26>F<><04>F<><13>y<EFBFBD>y<EFBFBD><14><EFBFBD><1E><>Gs<00>Ac<00>*<00>|jd<01>}|djd<03>dj<00>rH|D<00>cgc]}|jd<05>dd<00><02>}}t|<00>D]\}}dj|<01>||<<00>dj|<00>Scc}w)zEdelete the line mark at the begening of each line if line mark existsr<73>rI<00>.rr<>N)r<><00>isdigitr<74>r<>)r<>r<>r<>s r<rzzTaskTBsim.del_linemark<72>s<><00><00><14>z<EFBFBD>z<EFBFBD>$<24><1F><04> <0F><01>7<EFBFBD>=<3D>=<3D><13> <1D>a<EFBFBD> <20> (<28> (<28> *<2A>59<35>:<3A>T<EFBFBD>D<EFBFBD>J<EFBFBD>J<EFBFBD>t<EFBFBD>$<24>Q<EFBFBD>R<EFBFBD>(<28>:<3A>D<EFBFBD>:<3A>$<24>T<EFBFBD>?<3F> *<2A><07><01>4<EFBFBD><1E>)<29>)<29>D<EFBFBD>/<2F><04>Q<EFBFBD><07> *<2A><13>y<EFBFBD>y<EFBFBD><14><EFBFBD><1E><>;s<00>Bc<00>D<00>|jjd<01>r|jddn |j}tj|<01>D]R\}}}|D]G}|jd<04>s<01>tjtj
j ||<05><00><00>I<00>Ty)z$clean the .vcd files in the task_dirrNrRz.vcd<63>rrrq<00>walkr<6B>r<>r<><00>r;<00> clean_dir<69>root<6F>dirs<72>files<65>files r<rMzTaskTBsim.clean_vcd<63><00>~<00><00>*.<2E>-<2D>-<2D>*@<40>*@<40><13>*E<>D<EFBFBD>M<EFBFBD>M<EFBFBD>#<23>2<EFBFBD>&<26>4<EFBFBD>=<3D>=<3D> <09>!#<23><17><17><19>!3<> 8<> <1D>D<EFBFBD>$<24><05><1D> 8<><04><17>=<3D>=<3D><16>(<28><16>I<EFBFBD>I<EFBFBD>b<EFBFBD>g<EFBFBD>g<EFBFBD>l<EFBFBD>l<EFBFBD>4<EFBFBD><14>6<>7<> 8<> 8r>c<00>D<00>|jjd<01>r|jddn |j}tj|<01>D]R\}}}|D]G}|jd<04>s<01>tjtj
j ||<05><00><00>I<00>Ty)z$clean the .vvp files in the task_dirrNrRz.vvpr<70>r<>s r<r<>zTaskTBsim.clean_vvp<76>r<>r>N)rI)$<24>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__rr<>r=rrGrArBrKrLrXrYrJrVrsr<><00>boolr<6C><00> staticmethod<6F>intr<74><00>propertyr<79>rpr<>r<>r<>rTr{r<>rzrMr<><00>r>r<r r 6su<00><00><08>:#5<>j<EFBFBD>#5<>3<EFBFBD>#5<>s<EFBFBD>#5<>VY<56>#5<>dg<64>#5<>J<15>W<EFBFBD><1D>><3E><1E>><3E>(<19>:"+<2B>HV<01>" ,<2C>V<01>( ,<2C><1D> 6<><1C><1C>/<2F>S<EFBFBD>/<2F><14>/<2F>(<12> <17><13> <17>#<23> <17><12> <17><0E>r<01><0E>r<01><0E>?<3F><0E>?<3F><0E>9<><0E>9<><0E>6<><0E>6<><0E>:<3A><0E>:<3A><0E>.<2E><0E>.<2E> T<01><12><1F>3<EFBFBD><1F><12><1F> <12><1F>3<EFBFBD><1F><12><1F>8<>8r>r )r<>rq<00>LLM_callrt<00> iverilog_callri<00> python_callr<6C><00> loader_saverr~rrrrDr<00>prompt_scriptsrr<00> utils.utilsrr <00>
IDENTIFIER<EFBFBD>TESTBENCH_TEMPLATEr<45><00>DEBUG_FINAL_INSTRr<52>r<>r r<>r>r<<00><module>r<>s<><00><01><04>
<EFBFBD><16><1A><18><19><19>-<2D>(<28>1<>'<27><1E><14><02>
<EFBFBD>
<14>J<EFBFBD> <1F><1A>H<EFBFBD>!5<> 7<><12> <04> <1A> <1B><0E>m<02><11><04><11> m<02><14>j8<>j8r>