File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,10 +145,12 @@ class CosimWrapConfig extends CosimProcessConfig {
145145 ],
146146 environment: {
147147 if (environment != null ) ...environment! ,
148- 'PATH' :
149- '${Directory (directory ).absolute .path }/$_cosimVEnvName /bin:${Platform .environment ['PATH' ]}' ,
150- 'PYTHON3' :
151- '${Directory (directory ).absolute .path }/$_cosimVEnvName /bin/python3' ,
148+ if (usePythonVirtualEnvironment)
149+ 'PATH' :
150+ '${Directory (directory ).absolute .path }/$_cosimVEnvName /bin:${Platform .environment ['PATH' ]}' ,
151+ if (usePythonVirtualEnvironment)
152+ 'PYTHON3' :
153+ '${Directory (directory ).absolute .path }/$_cosimVEnvName /bin/python3' ,
152154 },
153155 // environment: environment,
154156 );
Original file line number Diff line number Diff line change @@ -52,5 +52,24 @@ Future<void> main() async {
5252 ];
5353 await SimCompare .checkFunctionalVector (mod, vectors);
5454 });
55+
56+ test ('simple bus - no Python venv' , () async {
57+ final mod = CosimBusMod (Logic (width: 4 ));
58+ await mod.build ();
59+
60+ const dirName = 'simple_bus' ;
61+
62+ await CosimTestingInfrastructure .connectCosim (dirName,
63+ systemVerilogSimulator: sim, usePythonVirtualEnvironment: false );
64+
65+ final vectors = [
66+ Vector ({'a' : 0 }, {'b' : 0 }),
67+ Vector ({'a' : 0x3 }, {'b' : 0x3 }),
68+ if (sim != SystemVerilogSimulator .verilator)
69+ Vector ({'a' : LogicValue .ofString ('01xz' )},
70+ {'b' : LogicValue .ofString ('01xz' )}),
71+ ];
72+ await SimCompare .checkFunctionalVector (mod, vectors);
73+ });
5574 });
5675}
Original file line number Diff line number Diff line change @@ -25,12 +25,16 @@ abstract class CosimTestingInfrastructure {
2525 ///
2626 /// Make sure to call [cleanupCosim] afterwards. If you set
2727 /// [cleanupAfterSimulationEnds] it will do it automatically for you.
28+ /// [usePythonVirtualEnvironment] and [cocotbVersion] control how the Cosim
29+ /// interacts with the host environment.
2830 static Future <void > connectCosim (
2931 String testName, {
3032 required SystemVerilogSimulator systemVerilogSimulator,
3133 bool enableLogging = false ,
3234 bool dumpWaves = false ,
3335 bool cleanupAfterSimulationEnds = true ,
36+ bool usePythonVirtualEnvironment = true ,
37+ String cocotbVersion = '1.9.2' ,
3438 }) async {
3539 if (enableLogging) {
3640 Logger .root.level = Level .ALL ;
@@ -43,6 +47,8 @@ abstract class CosimTestingInfrastructure {
4347 directory: tempDirName (testName, systemVerilogSimulator),
4448 enableLogging: enableLogging,
4549 dumpWaves: dumpWaves,
50+ usePythonVirtualEnvironment: usePythonVirtualEnvironment,
51+ cocotbVersion: cocotbVersion,
4652 ));
4753
4854 if (cleanupAfterSimulationEnds) {
You can’t perform that action at this time.
0 commit comments