EDAN15
Lab 1: FSMs
Skip to content
Dashboard
  • Login
  • Dashboard
  • Calendar
  • Inbox
  • History
  • Help
Close
  • My dashboard
  • EDAN15
  • Assignments
  • Lab 1: FSMs
2022 VT/Spring
  • Home
  • Assignments
  • Pages
  • Files
  • Syllabus
  • Quizzes
  • Modules
  • Collaborations
  • Office 365
  • Google Drive

Lab 1: FSMs

  • Due 5 Apr 2022 by 15:00
  • Points 1

This assignment requires you to design and simulate an FSM model using PtolemyII's Virgil. For a detailed description of how FSM modeling works in PtolemyII please consult the Using PtolemyII book, Chapter 6.

Task

Design and simulate an FSM able to parse the network packages formed according to the description below. The packages arrive as sequences of values to a unique input and your FSM has to identify the contents and output other values as requested by the packages. The FSM should also keep track of a "routing table" storing information received via packages as described below. You should handle the following sequences:

  1. 0, D - is a request for the routing table contents at index D
  2. 1, 0, D - update the routing table at index 0 with data D
  3. 1, 1, 0, D - update the routing table at index 1 with data D
  4. 1, 1, 1, D - update the routing table at index 2 with data D

The routing table should be initialized with -1 on all positions. Note that D may be any integer in most cases.

As an example, your FSM should be able to process the following sequence:
1, 1, 0, 5, 1, 0, 3, 0, 1, 1, 0, 4, 0, 2, 0, 0

by identifying cases III, II, I, II, I, I and producing outputs 5, -1, 4

You may use, for instance, a Sequence actor (Actor/Sources/SequenceSources) to generate inputs and a Display (Actor/Sinks/GenericSinks) to show the outputs.

Extend the sequence to cover the last case, and other combinations capturing all the transitions in your FSM.

Estimated required time, including (fast) reading about FSM modeling: 4h

Hints:

  • to check for the presence of an input S in your guards, use S_isPresent, see page 196.
  • if you are using the SDF Director to run your FSM as a ModalModel, make sure you give it enough iterations in the parameters to produce all the numbers in your sequence.
  • have a look at arrays in PtolemyII book, section 13.3.1, especially update function on page 465. You can use these internally to store your routing table.
1649163600 04/05/2022 03:00pm
Please include a description
Additional comments:
Rating max score to > Pts
Please include a rating title

Rubric

Find rubric
Please include a title
Find a rubric
Title
You've already rated students with this rubric. Any major changes could affect their assessment results.
 
 
 
 
 
 
 
     
Can't change a rubric once you've started using it.  
Title
Criteria Ratings Pts
This criterion is linked to a learning outcome Description of criterion
threshold: 5 pts
Edit criterion description Delete criterion row
5 to >0 Pts Full marks blank
0 to >0 Pts No marks blank_2
This area will be used by the assessor to leave comments related to this criterion.
pts
  / 5 pts
--
Additional comments
Total points: 5 out of 5