cs4272 hardware-software co-design assignment 1 school of computing national university of singapore...
TRANSCRIPT
![Page 1: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/1.jpg)
CS4272 Hardware-Software Co-designAssignment 1
School of ComputingNational University of Singapore
Guo Liang
![Page 2: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/2.jpg)
Assignment 1
Use Rhapsody to model a shuttle system– Due by: 20 Sep 2007– Individual work
The helping hand– IVLE discuss forum– Lab session: (COM1-01-14)
Tuesday 1400-1800 Wednesday 1500-1800
![Page 3: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/3.jpg)
Rhapsody
“visual design environment to create requirements and model embedded software”
– Analysis, design, implementation, and testing
Allows– Create UML model - class diagrams, object diagrams and
statecharts– Generate executable code for the model (Java, C, or C++)– Animate, execute and test the UML model
![Page 4: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/4.jpg)
Rhapsody
Basic usage– Create classes / objects– Create Statechart for classes– Set up model configuration– Generate code– Compile and run / animate
![Page 5: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/5.jpg)
Rhapsody
Available at COM1-01-14
Embedded Systems Teaching Lab 1 Tutorials
– Help List of Books Rhapsody in J tutorial
Demo
![Page 6: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/6.jpg)
Reminder - Procedure
Create classes, attributes, methods, and their associations and multiplicities
Create statecharts for classes Create objects, their initializations and their
links Edit “DefaultConfig” Run and debug
![Page 7: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/7.jpg)
Reminder - Add Object Diagram
![Page 8: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/8.jpg)
Reminder - Create Object
Object name
<instance name>:<class name> Initialization
![Page 9: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/9.jpg)
Create Event Argument
![Page 10: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/10.jpg)
Create Sequence Diagram
Role name All objects to be shown
![Page 11: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/11.jpg)
Shuttle System
A railway system– Shuttles running on it to transport passengers
Order-based system– Passenger places an order– Shuttles bid for the order– Successful shuttle move passengers from start
station to destination.
A management system (MS) controls orders.
![Page 12: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/12.jpg)
Shuttle System
4 stations connected in a ring
1 2
30
![Page 13: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/13.jpg)
Protocol – Order Assignment
Management System Shuttle 1ENV
order
order
offer
assign
Shuttle 2
order
offer
![Page 14: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/14.jpg)
Protocol – Shuttle Movement
ShuttleENV
depart
check
arrive
Track
not free
free
occupy
release
If track is occupied by another shuttle
If no shuttle on the track
![Page 15: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/15.jpg)
Order Assignment
ManagementSystem
s1
s2
neworders3
neworder
neworder
neworderEnv
shuttles
Order:•Start station•Destination•# of passengers
Shuttle:•Capacity•Unit fare•Initial station
![Page 16: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/16.jpg)
Order Assignment (Cont.)
s1
s2
refuses3
offer(20)
offer(10)
ManagementSystem
When to Offer:•No assignment;•Order size <= capacity
shuttles
May use the same event “offer” for both cases, e.g refuse = offer(9999)
![Page 17: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/17.jpg)
Order Assignment (Cont.)
s1
s2
s3
assign
ManagementSystem
shuttles
MS assigns order to shuttle s1, since it made the lowest offer of 10 dollars.
No event sent to s2 and s3.
![Page 18: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/18.jpg)
Process Order
After s1 (at station 1) got assignment (12, 5 passengers):1. It loads since it is already at start station 1.
s1
@station 1
load
![Page 19: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/19.jpg)
Process Order (Cont.)
2. It checks the availability of track, then move onto track if available.
s1TrackRequest to move
s1Trackoccupied
s1Trackfree
depart Env
@station 1
@track1
Move to track
![Page 20: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/20.jpg)
Process Order (Cont.)
s1Trackrelease
@track 1
arrive Env
3. It arrives destination, then unloads.
s1
@station 2
unload
![Page 21: CS4272 Hardware-Software Co-design Assignment 1 School of Computing National University of Singapore Guo Liang](https://reader036.vdocument.in/reader036/viewer/2022070402/56649f225503460f94c3acb1/html5/thumbnails/21.jpg)