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
3
votes
1 answer

apply init_val template to the uint64_attr

​Hi all, I want to apply the init_val template to several attributes in my model to reset them by sreset template. Attribute definition below can't be compiled by 166 base, any suggestions? attribute attr1[10] is (uint64_attr, init_val) { param…
Dmitry
  • 31
  • 2
3
votes
2 answers

Issue logging within an embedded C function

I'd like to generate logging messages from within a C function embedded in a DML method. Take the example code below where the fib() function is called from the write() method of the regs bank. The log methods available to C all require a pointer to…
3
votes
4 answers

Cannot use variable index in a constant list

Using the Device Modeling Language (DML), version 1.4. ​I create a param of lists like param X = [ [0, 0, 0], [0, 0, 1].......]; And I want to access them in a method using variable like method get_var(uint32 idx) -> (uint32) { return…
Yun
  • 31
  • 2
2
votes
3 answers

Field that relies on a value of a different field in the same register in DML 1.4

I have part of a register that looks something like this register CC { field CSS @ [6:4] is write { method write(uint64 value) { if (CC.EN.val == 0b1) { log spec_viol: "Command set selection should not " + …
toffe
  • 63
  • 5
2
votes
2 answers

How to iterate over the unmapped registers of a bank in DML 1.4?

I am trying to migrate some modules to DML 1.4 and I face some problems during bank content iteration. Specifically, I originally have the snippet below: select reg in ($signals.unmapped_registers) where (reg.signal_number == signal) { // some…
ggiakoum
  • 23
  • 2
2
votes
2 answers

How to call Python functions from DML?

I would like to have a DML device with interfaces and register banks as the TOP-level of my device but offload processing to Python. Is there a lightweight method of calling into Python from DML? This post How can I unit test a specific DML method?…
2
votes
1 answer

How to generate a parameter array

I am now developing a management unit that controls several IPs through corresponding control-fsm. These IPs are grouped in several group, and each group are controlled by one control-fsm. Thus I have a control_fsm_template and a ip_template, and in…
2
votes
1 answer

Is there an equivalent for C++:'template ' in DML?

For this template, is it possible to parameterize the uint32 type? template test_t { saved uint32 data; } I tried using param mytype = uint32, but did not work. Is it possible another way?
2
votes
1 answer

dmlc throws "unknown identifier" without using #if

Why do I get an unknown identifier error for the fail_test1 template and not in pass_test1? template pass_test1 { param len = 10; #if (true) { saved int8 data[len]; } } group pass is pass_test1; template fail_test1 { param len…
2
votes
2 answers

How do I implement a DML bank that is accessed through 3 different interfaces with varying access restrictions per interface?

I have device with a common register bank that can be accessed through 3 different interfaces, one is the "regular" interface where the register and fields have the normal access restriction (e.g. rw or ro) per the specification, but the other two…
Magnus
  • 21
  • 2
1
vote
1 answer

Is there any equivalent to the "final" keyword from C++ in DML?

I currently have a register template that defines a method called read_action that I am looking to deprecate. I'd ideally like to decorate this method in the base template in such a way that no other template or register/field that imports this…
1
vote
1 answer

Memory transaction exception forwarding in DML - Sim_PE_Stall_Cpu

A user has a register in a bank implementing a read method through the io_memory interface. The memory operation is served by a memory link returning Sim_PE_Stall_Cpu on the first attempt. At first glance, he doesn’t see a way to propagate the stall…
Juan Cruz
  • 21
  • 2
1
vote
3 answers

conditional logging in dml for speed in production environments

I would like to optimize the dml-code I have for speed in a production environment. As far as I understand log statements such as: log info, : ; Get translated in at least one if statement in the executable, because there is a need to…
njc
  • 11
  • 1
1
vote
1 answer

How can i iterate over banks in DML 1.4?

In DML 1.2 it's possible to use parameter banks to iterate over banks in device: foreach node_bank in (banks) { } But in DML 1.4 it produces error: error: undefined value: 'undefined' I tried to create a list with all banks in…
odenysex
  • 25
  • 2
1
vote
1 answer

Forward access to bank set method in dml 1.4

I am migrating some code to dml 1.4. Old code used the miss_bank parameter to handle miss read and writes and forward them to some other bank: dml 1.2; bank main_bank { parameter miss_bank = $dev.forwrad_bank; } bank forward_bank { // structure…
1
2