bashmakefilespike

How to prompt the commands that are written in a text file previously for spike?


I am using Spike to run a RISCV CPU. I will write the same set of commands many times that I wrote below

run 100 
reg 0
run 100
reg 0
run 100
reg 0

I actually want to automatize the command that I give to the spike. For example, taking commands from a text file and giving it to the spike can be a solution. However, I couldn't make it by using the makefile or text to bash method. As expected it is because in each case (after the spike command is entered) the commands are not entered before the spike stopped. Is there a way to enter a command without waiting for the completion of the previous one? I will use an automatic keyboard tool to enter commands just like entering from the keyboard if I cannot find a way to do it.


Solution

  • I found a solution that is written in the help menu. I think they added this feature later because I did carefully read all the help text (I may miss the point of course). The option can be used by the below command. " --debug-cmd= Read commands from file (use with -d)"