Origen-SDK / origen_sim

Plugin to enable Origen patterns to be run in a dynamic Verilog simulation
MIT License
1 stars 4 forks source link

Generic socket #10

Closed coreyeng closed 6 years ago

coreyeng commented 6 years ago

Added support for configuring an unknown toolchain (vendor). This was developed for ncsim, which, as part of cadence, probably could have its own vendor, but for now, I used it to prototype a generic tester. This requires you to setup at least a post_run_start_block process, which should be system commands (or anything, really) that starts up the testbench and passes it the socket. An example, using ncsim, is:

OrigenSim.generic(startup_timeout: 900) do |sim|
  sim.testbench_top 'na_origen'
  sim.post_run_start_block do |s|
    pid = Process.spawn("ncsim na_origen -loadpli origen.so:bootstrap +socket+#{s.socket_id}")
    puts "Spawning process: #{pid}"
  end
end

Updated the README, but plan to do more thorough docs once we start a website for OrigenSim.

A few other, more minor updates:

coreyeng commented 6 years ago

I can update the README to include the ncsim example. I was trying to keep it in generic terms and am thinking we might add a ncsim vendor later, if our other teams don't update to irun soon. But, I agree.

I'll need to pull this down to merge and re-test with master, so I'll update the README with the ncsim example as well.

ginty commented 6 years ago

Yeah, just having a look at how this is implemented with respect to the other PR about better process management, you may need to rethink how the pre/post run blocks are handled. I don't think it should be used as in this example where the user spawns the process and generates a PID, OrigenSim should manage that and this should be more about the user providing an alternative command to run.

coreyeng commented 6 years ago

Yes, I agree. I'll look into that as well. I still like the idea of being able to do some arbitrary setup and tear down, but OrigenSim should handle the command that's supposed to start the testbench.

coreyeng commented 6 years ago

This branch is actually used in a few of our applications and since I'm going to make non-backwards compatible changes, I'm going to leave this branch alone for now, push to a copy of the branch, PR that one, and then adjust the applications accordingly. I'll delete both branches when the other is merged and both apps are moved to the new release.

Thanks.

@chrisnappi