Questions tagged [dml-lang]

Questions about the Device Modeling Language (DML). Covers both core language questions such as syntax and semantics, and broader programming questions such as how best to model a certain type of hardware behavior using DML.

Questions related to programming in the Device Modeling Language (DML). This is a domain-specific language for building fast virtual platform device models.

Github.io homepage for the DML language and compiler: https://intel.github.io/dml-lang/

To run DML models, use the free public release of the Intel Simics simulator: https://software.intel.com/simics-simulator

26 questions
1
vote
2 answers

Casting layout to unsigned interger type in DML 1.4

I'm trying to cast a variable of type layout with a size of 4 bytes to an uint32. It is however not working. A layout: typedef layout "little-endian" { uint16 NSQA; uint16 NCQR; } DW0_set_features_fid_07; then local DW0_set_features_fid_07…
toffe
  • 63
  • 5
1
vote
1 answer

Implement Generic FIFO

I am looking into implementing a FIFO that can hopefully be reused in multiple devices. The FIFO template shall expose these methods push pop and len. I want the size of the FIFO to be defined as a parameter and I want the type the FIFO holds to be…
1
vote
1 answer

How can i specify parameter dependent on index value?

I'm trying to port code from DML 1.2 to DML 1.4. Here is part of code that i ported: group rx_queue [i < NQUEUES] { <...> param desctype = i < 64 #? regs.SRRCTL12[i].DESCTYPE.val #: regs.SRRCTL2[i - 64].DESCTYPE.val; // error occurs here …
odenysex
  • 25
  • 2
1
vote
2 answers

Register array with a field in only one of the registers in DML 1.4

I want to make a register array, where one of the registers should include a field in bit 0 with a value of 1. I have tried using a conditional without any success. register feature_bits[i < N_FEATURE_SELECT_REGS] size 4 is unmapped { #if (i ==…
toffe
  • 63
  • 5
1
vote
2 answers

How to use in each statement with mixed version dml devices?

Got a device with some common code in DML 1.4 where I want to verify a parameter is properly set on all fields of all registers by using and in each statement: dml 1.4; //import "each-bank.dml"; template stop_template { param stop default…
1
vote
1 answer

Create a register alias template that produces an error when aliased to itself

Question about "Alias Registers" concept from Model Builder guide. Would like to produce an error (ideally, a compile time error) when a register alias is accidentally aliased to itself :) Alias registers could be arrays. Comparing alias parameter…
sgolaev
  • 13
  • 3
1
vote
1 answer

How do I properly model internal memory in my serial flash device?

I am writing a model for a serial flash device. I wonder how do I best model the internal memory? I would like the memory size to be configurable by the user since I intend to reuse this model for different serial flashes. It also needs to retain…
1
vote
1 answer

How do I Implement a traffic light state machine in DML?

I am originally a C-developer and I am now getting familiar with DML. I often need to write state machines and I always design them very C-stylish. I suspect that I am not utilizing the DML language to its full extent. Could someone port this…
1
vote
1 answer

How can I unit test a specific DML method?

I'm writing some common DML code that contains a fairly complex method, something like: saved uint32 checksum_ini; method calculate_checksum(bytes_t data) -> (uint32 sum) { uint32 result = checksum_ini; for (int i = 0; i < data.size; ++i) { …
Erik Carstensen
  • 634
  • 4
  • 14
0
votes
1 answer

Limitations of params, saved and session DML declarations

How much data can be processed using params, saved and session declarations? How do these declaration affect performance and memory allocation/consumption (stack usage, data copy, etc.)? What methods can be used in case of static/dynamic arrays with…
Aleks
  • 1
  • 1
0
votes
1 answer

DML Conditional top level "in each" statements

When trying to use in each statements like the following I get an unknown identifier error. dml 1.4; param MACRO = true; #if (MACRO){ in each bank { in each register { param something = 1; } } } At compile time…
1
2