esim load shift.net puts "barrel shifter tests" esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 00010 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 00001 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim run 20 esim set shft 00011 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 01000 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 10000 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 11111 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" # test right shift puts " test right shift " esim set shft 00100 esim set left 0 esim set -hex a 87654321 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 00010 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 00001 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim run 20 esim set shft 00011 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 01000 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 10000 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 11111 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" # now test arithmetic puts " now test arithmetic, sign extend " esim set log 0 esim set shft 00100 esim set left 0 esim set -hex a 87654321 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 00010 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 00001 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim run 20 esim set shft 00011 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 01000 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 10000 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n" esim set shft 11111 esim run 20 puts "inp= [esim show -hex a], left= [esim show left], log= [esim show log]" puts "out= [esim show -hex b], shft= [esim show shft]\n"