I have coded an algorithm using MATLAB R2019 script and i want it to be called in an System verilog file i.e The output generated by the matlab script is actually to be fed into the testbench written using SV. I dont want to use HDL coder tool as the algorithm is quite complex and re-coding it in SV/ C is quite difficult. I use synopsys VCS tool for compilation and elaboration. My question is : 1. Is it possible that a MATLAB script to be called in testbench written in SV ? I've heard about DPI, but not much idea on it, or worked on it. 2. Can the output of the MATLAB script stored in a separate file, let's say for example a text file and i can call that file in my SV test bench.?
MATLAB script use in System verilog using SNPS VCS tool
319 Views Asked by Ansuman Mishra At
1
There are 1 best solutions below
Related Questions in MATLAB
- Convert Cell Array of Symbolic Functions to Double Array of Symbolic Functions MATLAB
- How to restrict vpasolve() to only integer solutions (MATLAB)
- "Error in port widths or dimensions" while producting 27
- matlab has encountered an internal problem needs to close
- Minimize the sum of squared errors between the experimental and predicted data in order to estimate two optimum parameters by using matlab
- Solve equation with Crank Nicolson and Newton iterative method in Matlab
- Why options are not available in EEGLAB menu options?
- ash: ./MathWorksProductInstaller: not found, but file exists
- iterative GA optimization algorithm
- Create Symbolic Function from Double Vector MATLAB
- Fixing FEA Model loading with correct units and stress results
- loading variables from a python script in matlab
- Why cannot I set font of `xlabel` in `plotmf` in MATLAB?
- How would I go about filtering non-standardly formatted serial data which contains some junk binary between data entries?
- Cyclic Voltammetry Simmulation in MATLAB, I am running into issues with my data points returning as NaN values, i am a beginner, any help wanted
Related Questions in VERILOG
- Error message coming up when compiling iVerilog Code
- Communicate/transfer data between two different programs. JAVA & VERILOG
- Spiking neural network on FPGA
- Matrix Multiplication Testbench Yields Inconsistent Results
- Formal verification of state machine with SymbiYosys not giving expected results
- How to compile only the changed files in Verilator?
- 4-bit ALU SLT operation
- How to connect combo code to a module's interface modport?
- 4-bit ALU using 1-bit ALU in verilog
- Is there a difference when using the ternary operator in always and assign statements?
- Verilog Implementation: Detecting Overflow and Rolling Up Result
- IO placement is infeasible error in Vivado
- How do I deploy this polynomial multiplication algorithm to verilog
- always block not always triggering at event
- Multiple modules in FSM and how it's working?
Related Questions in SYSTEM-VERILOG
- Matrix Multiplication Testbench Yields Inconsistent Results
- How to connect combo code to a module's interface modport?
- Send transactions using test cases to random channels
- systemverilog assertion become vacuous match when it has if...else statement
- How can I write this SystemVerilog property without the use of a local variable?
- always block not always triggering at event
- How to write into 12 addresses at the same cycle in vivado and still be recognized as BRAM
- Continuous Assignment of Class Property
- No .vcd file found error, but I have used the $dump code
- Verifying all address locations of memory
- Logical Error in Verilog code for converting SR FF to JK FF
- system-verilog - cross cover between generate-loop instances
- Gate-Level Sim: Hold time violation between testbench and first registers?
- Multiple instances of covergroup based on parameter
- Illegal hierarchical reference through a let construct
Related Questions in HDL-CODER
- Long inputs in Matlab HDL coder
- Error using Matlab HDL Coder
- Matlab hdl coding
- How do I implement matlab code on hardware device to make it run?
- CRC-16 and/or Frame Check Sequence
- MATLAB script use in System verilog using SNPS VCS tool
- Work with binary numbers as scalars in Matlab
- MATLAB coder error while converting code to hdl for xcorr function
- HDLC frame HCS and FCS
- I am using MATLAB HDL coder to convert matlab coder and currently having some error
- Feedback loop in Simulink/HDL Coder
- loop in Matlab/Simulink HDL
- Failed Cannot connect to 'Mentor Graphics ModelSim' HDL simulator
- Convert matlab-code into vhdl with HDL Workflow Advisor
- Why is a sum statement so bizarrely synthesized?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
To answer your questions in order, it is indeed possible.
You need to do the following:
In SV, import a C function (extern DPI-C) that you will call as required. Say we call this callMatlabFn
In C, define an extern function called callMatlabFn. This will then actually call your matlab fn. Have a look here for calling matlab in C : https://www.mathworks.com/help/matlab/matlab_external/call-matlab-functions-from-c-1.html
Finally, text File I/O in SV is implemented via the following system tasks: