Comments (4)
Regardless of how we attempted to assign values through cocotb simulation to the variables i2c_sda_di
, i2c_scl_di
, i2c_sda_do
, or i2c_scl_do
, which are connected to the IOBUF
module, the value remained as determined by the RTL.
Various approaches such as Force
, immediatevalue
, and others were tried, but none were successful. Ultimately, we created an empty IOBUF
module, which allowed setting values only on the I
(input) ports, while the O
(output) ports did not allow this.
All of these attempts were made using Verilator.
In the end, we switched to Icarus, which supports not only 0
and 1
but also 'X
and 'Z
, and there were absolutely no issues with the original IOBUF
module or the I2C simulation.
from openeye-camsi.
We used the cocotbext-i2c
library for simulating the slave device. In the Python script I2CDevice.py
, it was necessary to add the following to the constructor:
#....before
def __init__(self, sda=None, sda_o=None, scl=None, scl_o=None, *args, **kwargs):
self.log = logging.getLogger(f"cocotb.{sda._path}")
self.sda = sda
#......
#....after
def __init__(self, addr=None, sda=None, sda_o=None, scl=None, scl_o=None, *args, **kwargs):
self.log = logging.getLogger(f"cocotb.{sda._path}")
self.sda = sda
self.addr = addr
#.....
These changes were necessary for it to work properly. After making these modifications and running the cocotb simulation with the Icarus simulator, everything worked as expected. A testament to this is the successful write of 65 registers in the slave device.
from openeye-camsi.
do we still need this?:
`ifdef COCOTB_SIM
inout tri1 i2c_sda,
inout tri1 i2c_scl,
`else
inout wire i2c_sda,
inout wire i2c_scl,
`endif //COCOTB_SIM
If cocoTB+Verilator cannot override O port of the dummy IOBUF, try doing this in the dummy IOBUF:
logic O_from_coco;
assign O = O_from_coco;
then override O_from_coco
, which is now an input.
from openeye-camsi.
Also, look for all instances of COCOTB_SIM macro in RTL and try to remove them. Only if absolutely not possible, replace them with
SIM_ONLY. The goal is to rationalize the use of macros, as they have global scope.
from openeye-camsi.
Related Issues (13)
- HDMI HOT 10
- Line buffering HOT 1
- I2C HOT 1
- Pinout inconsistencies and Debayer module HOT 2
- Accumulated Cocotb issues/feature requests HOT 7
- issue#1 HOT 2
- issue#3 - Optimizations of I2C Master controller
- issue#4 - Creation of Standalone MMCM Model HOT 1
- issue#5 - cocotb spec, dev and status HOT 10
- issue#6 - csi_rx_align_word HOT 1
- Validation and introduction of CDC Linter into project QA workflow
- issue#7 - Enable HiRez Sony camera
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openeye-camsi.