driver: lay some scaffolding to allow us to optimize the stimulus in future

This commit is contained in:
2022-08-18 22:19:50 -07:00
parent ffda00b796
commit 35dbdffda7
2 changed files with 96 additions and 16 deletions

View File

@@ -43,7 +43,7 @@ use coremem::meas;
use coremem::real::{self, Real as _};
use coremem::sim::spirv::{self, SpirvSim};
use coremem::sim::units::Seconds;
use coremem::stim::{CurlVectorField, Exp, Gated, ModulatedVectorField, Shifted, StimExt as _, StimuliVec};
use coremem::stim::{CurlVectorField, Exp, Gated, ModulatedVectorField, Shifted, StimExt as _};
use coremem::Driver;
type R = real::R32;
@@ -248,7 +248,6 @@ fn main() {
})
.collect();
assert_eq!(stim.len(), 5);
let stim = StimuliVec::from_vec(stim);
let wire_mat = IsomorphicConductor::new(1e6f32.cast::<R>());
@@ -304,7 +303,10 @@ fn main() {
let duration = Seconds(params.clock_phase_duration * (num_cycles + 3) as f32);
// let stim = DynStimuli::from_vec(stim.map(MapIntoBoxStimulus).into_vec());
let mut driver = driver.with_stimulus(stim);
let mut driver = driver.with_concrete_stimulus();
for s in stim {
driver.add_stimulus(s);
}
let prefix = "out/applications/multi_core_inverter/20-4ns-1e7A/";
let _ = std::fs::create_dir_all(&prefix);