Skip to content
Snippets Groups Projects
Commit 5a56b49b authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

AVATAR: update on simulation panel + update on executable code

parent 72d5a291
Branches
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@ struct request {
struct request* relatedRequest; // For synchro and broadcast
struct syncchannel *syncChannel;
struct asyncchannel *asyncChannel;
int type;
int ID;
int hasDelay;;
......
......@@ -41,7 +41,17 @@ void executeSendSyncTransaction(request *req) {
// Remove all related request from list requests
//req->syncChannel->inWaitQueue = removeRequestFromList(req->syncChannel->inWaitQueue, selectedReq);
debugMsg("Setting related request");
req->relatedRequest = selectedReq;
selectedReq->relatedRequest = req;
if (req->relatedRequest == NULL) {
debugMsg("NULL related req");
}
if (selectedReq->relatedRequest == NULL) {
debugMsg("Other NULL related req");
}
// Select the selected request, and notify the information
selectedReq->selected = 1;
......@@ -80,7 +90,17 @@ void executeReceiveSyncTransaction(request *req) {
}
//req->syncChannel->outWaitQueue = removeRequestFromList(req->syncChannel->outWaitQueue, selectedReq);
debugMsg("Setting related request");
req->relatedRequest = selectedReq;
selectedReq->relatedRequest = req;
if (req->relatedRequest == NULL) {
debugMsg("NULL related req");
}
if (selectedReq->relatedRequest == NULL) {
debugMsg("Other NULL related req");
}
// Select the request, and notify the information in the channel
selectedReq->selected = 1;
......@@ -403,7 +423,7 @@ void private__makeRequest(request *req) {
// In all cases: remove other requests of the same list from their pending form
debugMsg("Removing original req");
removeAllPendingRequestsFromPendingLists(req, 1);
removeAllPendingRequestsFromPendingListsRelatedRequests(req);
//removeAllPendingRequestsFromPendingListsRelatedRequests(req);
/*if (req->relatedRequest != NULL) {
debugMsg("Removing related req");
removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
......@@ -416,7 +436,7 @@ void removeAllPendingRequestsFromPendingListsRelatedRequests(request *req) {
debugMsg("Removing related req");
removeAllPendingRequestsFromPendingLists(req->relatedRequest, 0);
// Recursive call
removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest);
//removeAllPendingRequestsFromPendingListsRelatedRequests(req->relatedRequest);
}
}
......
......@@ -161,7 +161,10 @@ void traceRequest(char *myname, request *req) {
switch(req->type) {
case SEND_SYNC_REQUEST:
debug2Msg("Sync channel", req->syncChannel->outname);
sprintf(s, "block=%s type=send_synchro channel=%s\n", myname, req->syncChannel->outname);
if ( req->relatedRequest == NULL) {
printf("NULL related\n");
}
sprintf(s, "block=%s type=send_synchro channel=%s blockdestination=%s\n", myname, req->syncChannel->outname, req->relatedRequest->listOfRequests->owner);
break;
case RECEIVE_SYNC_REQUEST:
sprintf(s, "block=%s type=receive_synchro channel=%s\n", myname, req->syncChannel->inname);
......
......@@ -168,7 +168,8 @@ public:
std::ostream& writeObject(std::ostream& s){
TMLEventSizedChannel<T,paramNo>::writeObject(s);
if (_eventFile!=0){
std::istream::streampos aPos=_eventFile->tellg();
//std::istream::streampos aPos=_eventFile->tellg();
int aPos=_eventFile->tellg();
WRITE_STREAM(s,aPos);
#ifdef DEBUG_SERIALIZE
std::cout << "Write: TMLEventBChannel " << this->_name << " posInFile: " << _eventFile->tellg() << std::endl;
......@@ -178,7 +179,8 @@ public:
}
std::istream& readObject(std::istream& s){
std::istream::streampos aPos;
//std::istream::streampos aPos;
int aPos;
TMLEventSizedChannel<T,paramNo>::readObject(s);
//std::cout << "Read Object TMLEventBChannel " << _name << std::endl;
if (_eventFile!=0){
......
......@@ -92,13 +92,15 @@ public class InteractiveSimulationActions extends AbstractAction {
public static final int ACT_UPDATE_BUS = 18;
public static final int ACT_UPDATE_TASKS = 19;
public static final int ACT_REFRESH = 32;
public static final int ACT_PRINT_CPUS = 28;
public static final int ACT_PRINT_BUS = 29;
public static final int ACT_ANALYSIS_RG = 30;
public static final int ACT_VIEW_RG = 31;
public static final int NB_ACTION = 32;
public static final int NB_ACTION = 33;
private static final TAction [] actions = new TAction[NB_ACTION];
......@@ -169,6 +171,7 @@ public class InteractiveSimulationActions extends AbstractAction {
actions[ACT_UPDATE_MEMS] = new TAction("update-mems", "Update Memories information", IconManager.imgic75, IconManager.imgic75, "Update Memories information", "Update information on Memories", 'R');
actions[ACT_UPDATE_BUS] = new TAction("update-bus", "Update bus info", IconManager.imgic75, IconManager.imgic75, "Update bus information", "Update information on busses", 'R');
actions[ACT_UPDATE_TASKS] = new TAction("update-tasks", "Update task information", IconManager.imgic75, IconManager.imgic75, "Update task information", "Update information on tasks", 'R');
actions[ACT_REFRESH] = new TAction("refresh", "Refresh transactions", IconManager.imgic75, IconManager.imgic75, "Refresh", "Refresh the Sequence Diagram representing transactions", 'R');
actions[ACT_PRINT_CPUS] = new TAction("print-cpus", "Print CPU info", IconManager.imgic75, IconManager.imgic75, "Print CPU information", "Print information on CPUs", 'R');
actions[ACT_PRINT_BUS] = new TAction("print-bus", "Print Bus info", IconManager.imgic75, IconManager.imgic75, "Print Bus information", "Print information on Busses", 'R');
......
......@@ -99,8 +99,7 @@ public class JFrameSimulationSDPanel extends JFrame implements ActionListener {
private static int[] clockDivisers = {1000000000, 1000000, 1000, 1};
protected JComboBox units;
protected JButton buttonClose;
protected JButton buttonRefresh;
protected JButton buttonClose, buttonRefresh;
protected JSimulationSDPanel sdpanel;
protected JLabel status;
//, buttonStart, buttonStopAndClose;
......@@ -147,6 +146,8 @@ public class JFrameSimulationSDPanel extends JFrame implements ActionListener {
units.setSelectedIndex(1);
units.addActionListener(this);
topPanel.add(units);
buttonRefresh = new JButton(actions[InteractiveSimulationActions.ACT_REFRESH]);
topPanel.add(buttonRefresh);
framePanel.add(topPanel, BorderLayout.NORTH);
// Simulation panel
......@@ -186,6 +187,12 @@ public class JFrameSimulationSDPanel extends JFrame implements ActionListener {
setVisible(false);
}
public void refresh() {
if (sdpanel != null ){
sdpanel.refresh();
}
}
public void actionPerformed(ActionEvent evt) {
......@@ -196,6 +203,10 @@ public class JFrameSimulationSDPanel extends JFrame implements ActionListener {
close();
return;
//TraceManager.addDev("Start simulation!");
} else if (command.equals(actions[InteractiveSimulationActions.ACT_REFRESH].getActionCommand())) {
refresh();
return;
//TraceManager.addDev("Start simulation!");
} else if (evt.getSource() == units) {
if (sdpanel != null) {
switch(units.getSelectedIndex()) {
......
......@@ -727,6 +727,17 @@ public class JSimulationSDPanel extends JPanel implements MouseMotionListener, R
Thread t = new Thread(this);
t.start();
}
public void refresh() {
if (mode == FILE_MODE) {
entityNames.clear();
transactions.clear();
transactionsOfPoints.clear();
points.clear();
Thread t = new Thread(this);
t.start();
}
}
public void run() {
TraceManager.addDev("Reading file");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment