puts "from ecomp add32.e pipe2.e -o pipe2.net" puts "from esim < pipe2.run > pipe2.out" esim load pipe2.net # load up the instruction memory with 32 bit works esim write -hex inst_mem.mr 0x0 32 80010004 esim write -hex inst_mem.mr 0x20 32 80020008 esim write -hex inst_mem.mr 0x40 32 8003000C esim write -hex inst_mem.mr 0x60 32 80040010 esim write -hex inst_mem.mr 0x80 32 80050014 # nop instructions to read out the registers into a_s2 and b_s2 esim write -hex inst_mem.mr 0xA0 32 00220000 esim write -hex inst_mem.mr 0xC0 32 00640000 esim write -hex inst_mem.mr 0xE0 32 00A60000 esim write -hex inst_mem.mr 0x100 32 00E80000 # 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 00112233 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 # stop just before the first clock in order to print esim run 199 for {set i 10} {$i} {incr i -1} { puts "ir_s1= [esim show -hex ir_s1] at clock [esim show cntr] events waiting=[esim events]" 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]" puts "wr_reg= [esim show wr_reg] wr_mem= [esim show wr_mem] memtoreg= [esim show memtoreg] alusrc= [esim show alusrc]" puts "rdto_s3= [esim show rdto_s3] rd_s3= [esim show rd_s3] rd_s4= [esim show rd_s4] regdst= [esim show regdst]\n" # stop just before the second clock in order to print esim run 200 } # # 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 "pipe2.out finished"