Skip to content

mlab-upenn/pvs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PVS: Pacemaker Verification System

Here is the source code for the Pacemaker Verification System project. The following is a breakdown of the source folders:

  • GUI/

    This folder contains the MATLAB code for the GUI monitor program. It has been tested on MATLAB versions 2009a, 2011a, and 2011b. It should theoretically work on standard MATLAB installations without additional packages. Execute PVS_GUI.m to run the GUI.

  • LookupModels/

    This folder contains the MATLAB Simulink and Stateflow models for the virtual heart. Simulink HDL Coder is required to convert these models to HDL for use on an FPGA. These models are known to work with MATLAB 2011a. The LookupModeling.mdl library contains the Stateflow models for the node and path automata. The other .mdl files are full heart models that have been linked with this library (the _scope models have Simulink scope entities for debugging via simulation). These full models can be generated with the build scripts in the scripts/ folder.

    These are called lookup models because they use lookup tables to calculate ERP lengths for the node automata as a function of activation time within RRP. As a result, these models consume significantly more resources than the simple models.

  • SimpleModels/

    This folder contains the MATLAB Simulink and Stateflow models for the virtual heart. Simulink HDL Coder is required to convert these models to HDL for use on an FPGA. These models are known to work with MATLAB 2011a. The SimpleModeling.mdl library contains the Stateflow models for the node and path automata. The other .mdl files are full heart models that have been linked with this library (the _scope models have Simulink scope entities for debugging via simulation). These full models can be generated with the build scripts in the scripts/ folder. The model case2mod_new.mdl was used for demonstration of the system, and is constructed from the case2mod_new.mat file using the build script.

    These are called simple models because they do not use lookup tables like the above lookup models.

  • hdl_harness/

    This folder contains the Verilog harness for running the virtual heart model on an FPGA. It handles all I/O for the virtual heart, such as sending beats and receiving paces to and from the pacemaker, and sending and receiving configuration data to and from the monitor PC running the MATLAB GUI.

    This harness was designed for the Terasic DE0-Nano evaluation board with an Altera Cyclone IV FPGA. Synthesis was performed through the Altera Quartus II free web edition development environment, version 11.1. Quartus projects were constructed with the Terasic SystemBuilder software. To use this harness, generate a project with the appropriate I/O (LEDs, GPIO, clock) in SystemBuilder. Copy these files into the project and reassign TopLevel.v as the top-level module. Then copy the autogenerated virtual heart model HDL files from Simulink into the project. Ensure that the heart model (in our case case2mod_new) matches with the instantiation in TopLevel.v. The project should now be ready for synthesis and flashing the board.

  • scripts/

    This folder contains the build data and the build script for constructing virtual heart models. Each .mat file represents a different heart, where the timing properties for each tissue node and the paths between them are established. The script buildmodel.m constructs the Simulink heart model .mdl using a .mat file for the topology and a library .mdl file for including the implementation of generic nodes and paths. For example, case2mod_new.mdl in SimpleModeling was constructed using case2mod_new.mat as the topology and SimpleModeling.mdl as the library. The build scripts have been tested in MATLAB 2011a and 2011b and should only require the Simulink and Stateflow packages.

Contact:

About

Pacemaker Verification System project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published