Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.4K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:
GROUPS:

Modelica language question

Posted 11 years ago
POSTED BY: Fulvio Spagna
4 Replies
Posted 11 years ago
POSTED BY: Fulvio Spagna
Posted 11 years ago
POSTED BY: Johan Rhodin
Posted 11 years ago

Hi Johan,

It has now been four months since the original post was published and I have not hear anything on this topic. Can you give me an update?

Thank you,

Fulvio

POSTED BY: Fulvio Spagna
Posted 11 years ago

Some comments that might help:

You haven't connected any sources to the component, that would be needed for you to get a useful simulation. See Modelica.Electrical.Digital.Examples.DFFREG for an example of connecting (and initializing) sources.

To make it easier to debug I renamed FF[1], FF[2] to FF1 and FF2:

model test
  import D = Modelica.Electrical.Digital;
  import L = Modelica.Electrical.Digital.Interfaces.Logic;
  import S = Modelica.Electrical.Digital.Interfaces.Strength;
  parameter Integer n = 1;
  parameter Integer nn(min = 1) = 2 "Number of bits";
  parameter Modelica.SIunits.Time tHL = 0.1 "High->Low delay";
  parameter Modelica.SIunits.Time tLH = 0.1 "Low->High delay";
  parameter D.Interfaces.Strength strength = S.'S_X01' "output strength";
  D.Registers.DFFREG FF1;
  D.Registers.DFFREG FF2;
  D.Basic.Not INV;
  D.Interfaces.DigitalInput reset;
  D.Interfaces.DigitalInput clock;
  D.Interfaces.DigitalOutput q[nn];
equation
  connect(clock, FF1.clock);
  connect(reset, FF1.reset);
  connect(FF1.dataOut[1], q[1]);
  connect(FF1.dataOut[1], FF2.dataIn[1]);
  connect(clock, FF2.clock);
  connect(reset, FF2.reset);
  connect(FF2.dataOut[1], q[2]);
  connect(FF2.dataOut[1], INV.x);
  connect(INV.y, FF1.dataIn[1]);
end test;

The model now validates and has 47 equations and 47 variables. I hope that helps.

POSTED BY: Johan Rhodin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard