<s> import Assembler <EOL> from memory_map import mem_map <EOL> bench_dir = "<STR_LIT>" <EOL> bench_file = "<STR_LIT>" <EOL> bench_name = bench_dir + "<STR_LIT:/>" + bench_file <EOL> SIMD_bench_name = bench_dir + "<STR_LIT:/>" + "<STR_LIT>" + bench_file <EOL> def assemble_PC ( ) : <EOL> PC = Assembler . PC_Memory ( bench_name ) <EOL> PC . set_pc ( <NUM_LIT:1> , "<STR_LIT>" ) <EOL> PC . set_pc ( <NUM_LIT> , "<STR_LIT>" ) <EOL> PC . set_pc ( <NUM_LIT> , "<STR_LIT>" ) <EOL> PC . set_pc ( <NUM_LIT> , "<STR_LIT>" ) <EOL> PC . set_pc ( <NUM_LIT> , "<STR_LIT>" ) <EOL> PC . set_pc ( <NUM_LIT> , "<STR_LIT>" ) <EOL> PC . set_pc ( <NUM_LIT> , "<STR_LIT>" ) <EOL> PC . set_pc ( <NUM_LIT> , "<STR_LIT>" ) <EOL> return PC <EOL> def assemble_A ( ) : <EOL> A = Assembler . Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT:A>" ] [ "<STR_LIT>" ] ) <EOL> return A <EOL> def assemble_B ( ) : <EOL> B = Assembler . Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT:B>" ] [ "<STR_LIT>" ] ) <EOL> return B <EOL> def assemble_I ( A , B ) : <EOL> I = Assembler . Instruction_Memory ( bench_name , A , B , write_offset = mem_map [ "<STR_LIT:I>" ] [ "<STR_LIT>" ] ) <EOL> return I <EOL> def assemble_XDO ( ) : <EOL> ADO = Assembler . Default_Offset_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> BDO = Assembler . Default_Offset_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> DDO = Assembler . Default_Offset_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] , width = <NUM_LIT:12> ) <EOL> return ADO , BDO , DDO <EOL> def assemble_XPO ( ) : <EOL> APO = Assembler . Programmed_Offset_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> BPO = Assembler . Programmed_Offset_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> DPO = Assembler . Programmed_Offset_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] , width = <NUM_LIT:12> ) <EOL> return APO , BPO , DPO <EOL> def assemble_XIN ( ) : <EOL> AIN = Assembler . Increments_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> BIN = Assembler . Increments_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> DIN = Assembler . Increments_Memory ( bench_name , file_ext = "<STR_LIT>" , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> return AIN , BIN , DIN <EOL> def assemble_branches ( ) : <EOL> BO = Assembler . Branch_Origin_Memory ( bench_name , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> BD = Assembler . Branch_Destination_Memory ( bench_name , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> BC = Assembler . Branch_Condition_Memory ( bench_name , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> BP = Assembler . Branch_Prediction_Memory ( bench_name , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> BPE = Assembler . Branch_Prediction_Enable_Memory ( bench_name , write_offset = mem_map [ "<STR_LIT>" ] [ "<STR_LIT>" ] ) <EOL> return BO , BD , BC , BP , BPE <EOL> def assemble_all ( ) : <EOL> PC = assemble_PC ( ) <EOL> A = assemble_A ( ) <EOL> B = assemble_B ( ) <EOL> I = assemble_I ( A , B ) <EOL> ADO , BDO , DDO = assemble_XDO ( ) <EOL> APO , BPO , DPO = assemble_XPO ( ) <EOL> AIN , BIN , DIN = assemble_XIN ( ) <EOL> BO , BD , BC , BP , BPE = assemble_branches ( ) <EOL> empty = { "<STR_LIT>" : PC , "<STR_LIT:A>" : A , "<STR_LIT:B>" : B , "<STR_LIT:I>" : I , <EOL> "<STR_LIT>" : ADO , "<STR_LIT>" : BDO , "<STR_LIT>" : DDO , <EOL> "<STR_LIT>" : APO , "<STR_LIT>" : BPO , "<STR_LIT>" : DPO , <EOL> "<STR_LIT>" : AIN , "<STR_LIT>" : BIN , "<STR_LIT>" : DIN , <EOL> "<STR_LIT>" : BO , "<STR_LIT>" : BD , "<STR_LIT>" : BC , "<STR_LIT>" : BP , "<STR_LIT>" : BPE } <EOL> return empty <EOL> def dump_all ( empty ) : <EOL> for memory in empty . values ( ) : <EOL> memory . file_dump ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> empty = assemble_all ( ) <EOL> dump_all ( empty ) </s>
