puts "from ecomp add32.e bshift.e part2.e -o part2.net" puts "from esim < part2a.run > part2a.out" esim load part2.net # revised 11/11/99 # load up the instruction memory with 32 bit works # lw 1,4(0) no stall esim write -hex inst_mem.mr 0x0 32 80010004 # lw 2,8(0) no stall esim write -hex inst_mem.mr 0x20 32 80020008 # add 3,1,2 stall 1 then data forwarding esim write -hex inst_mem.mr 0x40 32 10221801 # add 4,3,1 no stall esim write -hex inst_mem.mr 0x60 32 10612001 # beq 4,3,3 stall 1 then data forwarding esim write -hex inst_mem.mr 0x80 32 04830003 # lw 5,24(0) no stall, branch slot esim write -hex inst_mem.mr 0xA0 32 80050018 # lw 6,28(0) no stall esim write -hex inst_mem.mr 0xC0 32 8006001C # beq 5,6,3 stall 2, then data forward esim write -hex inst_mem.mr 0xE0 32 04A60003 # lw 7,32(0) no stall, branch slot esim write -hex inst_mem.mr 0x100 32 80070020 # sw 7,8(0) stall 1, then data forwarding esim write -hex inst_mem.mr 0x120 32 E0070020 # lw 8,0(0) no stall esim write -hex inst_mem.mr 0x140 32 80080000 # sw 6,0(8) stall on index esim write -hex inst_mem.mr 0x160 32 E1060000 # lw 8,0(0) no stall esim write -hex inst_mem.mr 0x180 32 80080000 # lw 9,0(8) stall on index esim write -hex inst_mem.mr 0x1A0 32 81090000 # nop esim write -hex inst_mem.mr 0x1C0 32 00000000 # nop esim write -hex inst_mem.mr 0x1E0 32 00000000 # nop esim write -hex inst_mem.mr 0x200 32 00000000 # nop esim write -hex inst_mem.mr 0x220 32 00000000 # # load register zero with zero, hopefully safe from software bug that # might change it esim write -hex greg.mr 0x0 32 00000000 # load data memory with 32 bit words esim write -hex dmem.mr 0x0 32 00000004 esim write -hex dmem.mr 0x20 32 11111111 esim write -hex dmem.mr 0x40 32 22222222 esim write -hex dmem.mr 0x60 32 33333333 esim write -hex dmem.mr 0x80 32 44444444 esim write -hex dmem.mr 0xA0 32 55555555 esim write -hex dmem.mr 0xC0 32 66666666 esim write -hex dmem.mr 0xE0 32 77777777 esim write -hex dmem.mr 0x100 32 88888888 esim write -hex dmem.mr 0x120 32 99999999 esim write -hex dmem.mr 0x140 32 AAAAAAAA esim write -hex dmem.mr 0x160 32 BBBBBBBB # stop just before the second clock in order to print esim run 199 for {set i 26} {$i} {incr i -1} { puts "inst = [esim show -hex inst ] at [esim curtime]ns" puts "ir_s1= [esim show -hex ir_s1] a_to= [esim show -hex a_to_s2] b_to= [esim show -hex b_to_s2]" puts "ir_s2= [esim show -hex ir_s2] a_s2= [esim show -hex a_s2] b_s2= [esim show -hex b_s2] c_s2= [esim show -hex c_s2]" puts "ir_s3= [esim show -hex ir_s3] a_s3= [esim show -hex a_s3] b_s3= [esim show -hex b_s3]" puts "ir_s4= [esim show -hex ir_s4] a_s4= [esim show -hex a_s4] b_s4= [esim show -hex b_s4] waiting=[esim events]\n" # stop just before the clock in order to print esim run 200 } # # dump registers and memory # output some general registers puts " General registers at end of simulation " puts "greg 0- 3= [esim read -hex greg.mr 0x0 32] [esim read -hex greg.mr 0x20 32] [esim read -hex greg.mr 0x40 32] [esim read -hex greg.mr 0x60 32]" puts "greg 4- 7= [esim read -hex greg.mr 0x80 32] [esim read -hex greg.mr 0xA0 32] [esim read -hex greg.mr 0xC0 32] [esim read -hex greg.mr 0xE0 32]" puts "greg 8-11= [esim read -hex greg.mr 0x100 32] [esim read -hex greg.mr 0x120 32] [esim read -hex greg.mr 0x140 32] [esim read -hex greg.mr 0x160 32]" puts "greg12-15= [esim read -hex greg.mr 0x180 32] [esim read -hex greg.mr 0x1A0 32] [esim read -hex greg.mr 0x1C0 32] [esim read -hex greg.mr 0x1E0 32]" # # more output, data memory puts " Data Memory at end of simulation " puts "dmem 0- 3= [esim read -hex dmem.mr 0x0 32] [esim read -hex dmem.mr 0x20 32] [esim read -hex dmem.mr 0x40 32] [esim read -hex dmem.mr 0x60 32]" puts "dmem 4- 7= [esim read -hex dmem.mr 0x80 32] [esim read -hex dmem.mr 0xA0 32] [esim read -hex dmem.mr 0xC0 32] [esim read -hex dmem.mr 0xE0 32]" puts "dmem 8-11= [esim read -hex dmem.mr 0x100 32] [esim read -hex dmem.mr 0x120 32] [esim read -hex dmem.mr 0x140 32] [esim read -hex dmem.mr 0x160 32]" puts "dmem12-15= [esim read -hex dmem.mr 0x180 32] [esim read -hex dmem.mr 0x1A0 32] [esim read -hex dmem.mr 0x1C0 32] [esim read -hex dmem.mr 0x1E0 32]" # puts "part2a.out finished"