Git Product home page Git Product logo

device-modeling-language's Introduction

Device Modeling Language

The Device Modeling Language (DML) is a domain-specific language for writing fast functional or transaction-level device models for virtual platforms. DML provides high-level abstractions suitable for functional device models, including constructs like register banks, registers, bit fields, event posting, interfaces between models, and logging. DML code is compiled by the DML Compiler (DMLC), producing C code with API calls tailored for a particular simulator.

Currently, the compiler supports building models for the Intel® Simics® simulator, but other back-ends may be added in the future.

Building and testing DMLC

To build DMLC, you need to have a Simics simulator installation and a Simics project set up.

Using the Public Release of the Intel Simics Simulator

If you do not already have a Simics simulator installation or access to the Simics simulator via commercial channels, install the Public Release of the Intel Simics simulator and create a Simics project (automatic in the default installation flow).

Building DMLC from a Simics project

In your Simics project, check out the DML repository into the modules/dmlc directory. At the top-level of the project, do make dmlc (or bin\make dmlc on Windows).

Testing DMLC from a Simics project

To run the unit tests provided with DMLC, run make test-dmlc or bin/test-runner --suite modules/dmlc/test from the top-level of the project.

Environment variables

The following environment variables are handy when developing DMLC. If you work regularly with a locally built DMLC, then consider setting the variables DMLC_DIR T126_JOBS, DMLC_PATHSUBST and PY_SYMLINKS in your .bashrc. Remaining variables are better to only enable when needed.

DMLC_DIR

After building DMLC, you need to set DMLC_DIR to <your-project>/<hosttype>/bin in subsequent invocations of make in order to build devices with the locally build compiler. <hosttype> is either linux64 or win64 depending on your host type.

T126_JOBS

When set, the given number of tests are run in parallel.

DMLC_PATHSUBST

The DMLC build copies a few DML library files, e.g. dml-builtins.dml, into <hosttype>/bin. When a compile error happens, error messages will normally point to this copy rather than the source. By setting DMLC_PATHSUBST to <hosttype>/bin/dml=modules/dmlc/lib, error messages will be rewritten to point to the source file instead. <hosttype> is either linux64 or win64 depending on your host type.

PY_SYMLINKS

When set to 1, make dmlc will symlink Python files instead of copying them. This has two effects: Python tracebacks will bring you to the source file in the repository, and you don't need to re-run make after editing Python files.

DMLC_DEBUG

When set to 1, unexpected exceptions in the compiler are echoed to stderr. The default is to hide tracebacks in a file dmlc-error.log.

DMLC_CC

Override the default compiler in unit tests.

DMLC_PROFILE

When set, DMLC does self-profiling and writes the profile to a .prof file.

DMLC_DUMP_INPUT_FILES

When set, DMLC emits a .tar.xz archive containing all DML source files, packaged on a form that can be compiled standalone. This is useful when a DML problem appears within a complex build environment, and you want to reproduce the problem in isolation. In the created archive, all DML files are located in the same directory (either top level or under a series of subdirectories called _), and relative imports are handled by also including symlinks in the archive. On Windows, DMLC is sometimes unable to resolve these symlinks correctly; for this reason, it is recommended that the archive is only extracted and compiled on Linux.

device-modeling-language's People

Contributors

adklimki avatar andreashedstrom-intel avatar jakob-engblom-i avatar jhbaarnh avatar jonatanwaern avatar lwaern-intel avatar mandolaerik avatar sgronlun avatar svenwest avatar syssimics avatar yulyugin avatar zhang-peng-j avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.