/////////////////////////////////////////////////////////////////////// // // BMP390 Digital Pressure Sensor module // // this model is empty // // a more advanced version will attempt to mimic the behaviour of // the real BMP390 device in I2C mode // // (note that since this is effectively part of the testbench // there is no need for this model to be synthesizable) // // Ports: // SDI/SDA (Inout) // I2C Bidirectional Data pin // // SCK/SCL (Input) // I2C Clock pin // // SDO (Input) // Determines I2C device address: // Device Address = 1110110 if (SDO==0) // Device Address = 1110111 if (SDO==1) // // CSB (Input) // Must be allowed to float to for I2C operation // // INT (Output) // Interrupt signal // // /////////////////////////////////////////////////////////////////////// module bmp390 ( inout SDI, input SCK, input SDO, input CSB, output INT ); timeunit 1ns; timeprecision 100ps; // the real variables "pressure" and "temperature" represent values // for environmental parameters // real pressure; // pressure in millibars real temperature; // temperature in Celcius // // the values specified here should be both conservative // and easy to achieve in practice // // these values have been selected to support a transfer rate // of 100kbits/s // specify // Serial clock timings $period(posedge SCK, 9us); $width(posedge SCK, 4us); $width(negedge SCK, 4us); // Serial Data timings relative to the clock $setup(SDI, posedge SCK, 2us); $setup(SDI, negedge SCK, 2us); endspecify endmodule