Selecting sproc1 CPU (Press Enter Here) sproc1>loadprg a.out (On prompt gave loadprg command) Endianness of the ELF file:0 .text matched [text segment] flag = 0x3 .ctors matched [data segment] flag = 0x3 .dtors matched [data segment] flag = 0x3 .data matched [data segment] sproc1>run(on prompt gave run command) Run mode selected Buffer Empty = 32 Buffer Empty = 32 Buffer Empty = 32 Buffer Empty = 32 Buffer Empty = 28 SWBKPT hit for SLOT 1..!! PC-Value : 0x124 Blk Count = 1 Cycles : 332(Here is the problem.. Unable to give Enter input to get back the prompt) sproc1>dump mem 74010 4(On prompt gave dump command) 0x74010:: 0x00000000 sproc1>quit #### Selecting sproc1 CPU sproc1> sproc1>loadprg a.out Endianness of the ELF file:0 .text matched [text segment] flag = 0x3 .ctors matched [data segment] flag = 0x3 .dtors matched [data segment] flag = 0x3 .data matched [data segment] sproc1>run Run mode selected Buffer Empty = 32 Buffer Empty = 32 Buffer Empty = 32 Buffer Empty = 32 Buffer Empty = 28 SWBKPT hit for SLOT 1..!! PC-Value : 0x124 Blk Count = 1 Cycles : 332 #### use Expect; chdir '/home/...some place.....' or die "Can't change directory : $!"; my $expect = Expect->new; my $command = './simulator/pruthvi.out'; my @parameters = qw(-m 4); my $timeout = 2; #$expect->raw_pty(0); $expect->spawn($command,@parameters ) or die "Cannot spawn : $!\n"; $expect->expect($timeout,"Selecting sproc1 CPU"); $expect->send("\n\n"); $expect->expect($timeout,"sproc1>"); $expect->send("loadprg a.out\n"); $expect->expect("sproc1>"); $expect->send("run\n"); $expect->expect($timeout,"SWBKPT hit for SLOT"); $expect->send("\n\n"); $expect->expect("sproc1>"); $expect->send("dump mem 74010 4 \n"); $expect->expect("sproc1>"); $expect->send("\n"); #### #!/bin/sh #!/usr/bin/expect cd /home/...some place../ expect -c ' set timeout 2 set file [open /home/aaa w] # log_user 1 spawn ./simulator/pruthvi.out -m 4 expect "Selecting sproc1 CPU" send "\n\n" expect "sproc1>" send "loadprg a.out\n" expect "sproc1>" send "run\n" expect "SWBKPT hit for SLOT" send "\n" expect "sproc1>" send "dump mem 74010 4 \r" expect "sproc1>" puts $file "$expect_out(buffer)" send "quit\n" #puts $file "$expect_out(buffer)" expect eof '