Running simulation
Running simulation
Important
Make sure that you have initialised the virtual environment following these instructions.
Options
These are the arguments for gerber2ems
Option | Description |
---|---|
-h
--help | Prints the help message. |
--config [file] | Specifies the location of the simulation configuration file.default: ./simulation.json |
-i [dir]
--input [dir] | Specifies the directory containing the exported Gerber, drill and simulation port files.default: ./fab |
-o [dir]
--output [dir] | Specifies the location of the: geometry data, simulation results, export E-fields, and post processed graphs.default: ./ems |
-c
--convert | Convert Gerber files to images. |
-g
--geometry | Create geometry files for openEMS. |
-s
--simulate | Run openEMS simulation. |
-p
--postprocess | Process openEMS results into S parameters and impedance values and saves them to a csv file. |
-r
--render | Renders graph of processed data. |
-a
--all | Run convert, geometry, simulate, and postprocess steps. |
--ef
--export-field | Flag to enable exporting field data if specified in layer config. |
-t [threads]
--threads [threads] | Number of threads that openEMS simulation will use.default: auto |
-d
--debug | Flag to enable debug level logging output. |
-l [level]
--log [level] | Set logging level: [DEBUG, INFO, WARNING, ERROR] .default: INFO |
Explanation
These are the following steps taken to go from your exported PCB files to graphs.
Step | Description |
---|---|
Convert | Gerber files are converted into images using gerbv . |
Geometry | PCB image files, via drills, simulation port and PCB stackup configuration are read to produce a single geometry.xml file. |
Simulation | openEMS imports the geometry.xml file and simulation configuration to produce E-field data (if exported) and time domain port measurements for each excitation source. |
Postprocessing | openEMS data is processed into S-parameters, impedance values (for signal traces and differential traces), and graphs are generated for each of these accordingly |
Examples
Consider an example where our directory has:
./fab
generated by KiCAD 8.0 according to these settings../simulation.json
written according to these guidelines.- Virtual environment has been activated according to these instructions.
- bash shell is already inside this directory.
Run entire pipeline and output to default location
gerber2ems -a
Run entire pipeline and input/output from custom locations
gerber2ems --config "custom_simulation.json" -i "custom_fab/" -o "custom_results/" -a
Run convert to images pass only
gerber2ems -c
Run geometry pass only
gerber2ems -g
Run simulation pass only
gerber2ems -s
Run postprocessing results only
gerber2ems -p
Run graph rendering only
gerber2ems -r
Run simulation with custom number of threads
gerber2ems -a --threads 16
Run simulation and export field data
gerber2ems -a --export-field