Skip to content

Commit

Permalink
[microTVM] make RVM memory and number of cores variable (apache#8154)
Browse files Browse the repository at this point in the history
* ram/cpu variable

* tvm prefix
  • Loading branch information
mehrdadh authored and trevor-m committed Jun 17, 2021
1 parent 9c593a1 commit d2a7a2b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/microtvm/reference-vm/zephyr/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
Vagrant.configure("2") do |config|
config.vm.box = "tlcpack/microtvm-zephyr-2.5"

if ENV.has_key?("TVM_RVM_NUM_CORES")
num_cores = ENV["TVM_RVM_NUM_CORES"]
else
num_cores = 2
end

if ENV.has_key?("TVM_RVM_RAM_BYTES")
ram_bytes = ENV["TVM_RVM_RAM_BYTES"]
else
ram_bytes = 2048
end

tvm_home = "../../../.."
dirs_to_mount = [Pathname.new(Pathname.new(tvm_home).expand_path())]
if ENV.has_key?("TVM_PROJECT_DIR") then
Expand All @@ -40,6 +52,8 @@ Vagrant.configure("2") do |config|
vm_name = "microtvm-#{Time.now.tv_sec}"
config.vm.provider "virtualbox" do |vb, overrides|
vb.name = vm_name
vb.cpus = num_cores
vb.memory = ram_bytes
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbehci", "on"]
vb.customize ["modifyvm", :id, "--usbxhci", "on"]
Expand All @@ -50,6 +64,8 @@ Vagrant.configure("2") do |config|

config.vm.provider "parallels" do |prl, overrides|
prl.name = vm_name
prl.cpus = num_cores
prl.memory = ram_bytes
prl.update_guest_tools = true
prl.customize ["set", :id, "--support-usb30", "on"]
dirs_to_mount.each do |d|
Expand All @@ -58,6 +74,8 @@ Vagrant.configure("2") do |config|
end

config.vm.provider "vmware_desktop" do |vm, overrides|
vm.cpus = num_cores
vm.memory = ram_bytes
vm.vmx["usb_xhci.present"] = "TRUE"
vm.vmx["usb.present"] = "TRUE"
vm.vmx["ehci.present"] = "TRUE"
Expand Down

0 comments on commit d2a7a2b

Please sign in to comment.