Skip to content
Snippets Groups Projects
Commit 0d5c2d43 authored by Minh Hiep Pham's avatar Minh Hiep Pham :speech_balloon:
Browse files

Updated JDialogCPUNode.java, helpTable.txt and added markdown files for cpu node help

parent 8d5d18d8
No related branches found
No related tags found
1 merge request!122Updated cpu node help for linking to html files
Showing
with 108 additions and 94 deletions
......@@ -42,7 +42,10 @@
package ui.window;
import cli.Action;
import help.HelpEntry;
import help.HelpManager;
import myutil.GraphicLib;
import myutil.TraceManager;
import tmltranslator.modelcompiler.ArchUnitMEC;
import ui.ColorManager;
import ui.util.IconManager;
......@@ -93,8 +96,8 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
private java.util.List<SimulationTransaction> transactions;
//issue 183
List<JTextArea> instructionHelpList;
List<JButton> buttons;
List<JButton> buttons = new ArrayList<>();
List<HelpEntry> helpEntries;
/* Creates new form */
public JDialogCPUNode(Frame _frame, String _title, TMLArchiCPUNode _node, ArchUnitMEC _MECType, java.util.List<SimulationTransaction> _transactions) {
......@@ -121,114 +124,82 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
}
//issue 183
private void buttonClick(JButton but, JTextArea jta) {
JPopupMenu helpPopup = new JPopupMenu();
helpPopup.add(jta);
but.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (!helpPopup.isVisible()) {
helpPopup.show(but,20,20);
} else {
helpPopup.setVisible(false);
}
}
});
helpPopup.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "closeJTextArea");
helpPopup.getActionMap().put("closeJTextArea", new AbstractAction() {
private void buttonClick(JButton but, HelpEntry he, HelpManager hm) {
but.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
helpPopup.setVisible(false);
JFrameHelp jhf = new JFrameHelp("help", hm, he);
jhf.setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
//jhf.setAutoRequestFocus(true);
//jhf.setFocusableWindowState(true);
but.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "close");
but.getActionMap().put("close", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
if(!jhf.isVisible())
dispose();
jhf.setVisible(false);
}
});
}
});
}
//issue 183
private void hardwareHelp(){
instructionHelpList = new ArrayList<>();
buttons = new ArrayList<>();
JTextArea jft1 = new JTextArea();
jft1.setText("CPU name");
instructionHelpList.add(jft1);
JTextArea jft2 = new JTextArea();
jft2.setText("The arbitration policy used by OS to schedule mapped tasks");
instructionHelpList.add(jft2);
JTextArea jft3 = new JTextArea("Slice time : The maximum time allocated by the OS " +
"scheduler to execute a task");
instructionHelpList.add(jft3);
JTextArea jft4 = new JTextArea("Nb of Cores : The number of cores of the CPU");
instructionHelpList.add(jft4);
JTextArea jft5 = new JTextArea("Data size : The size of an EXECI/EXECC operation, in " +
"number of bytes");
instructionHelpList.add(jft5);
JTextArea jft6 = new JTextArea("Pipeline size : The number of stages of the pipeline");
instructionHelpList.add(jft6);
JTextArea jft7 = new JTextArea("Task switching : The time taken by the OS for a context switch");
instructionHelpList.add(jft7);
JTextArea jft8 = new JTextArea("Mis-branching prediction: The miss percentage of the CPU branch " +
"prediction scheme");
instructionHelpList.add(jft8);
JTextArea jft9 = new JTextArea("cahe-miss : The percentage of cache misses");
instructionHelpList.add(jft9);
JTextArea jft10 = new JTextArea("Go idle time (cycles) : The time taken by the OS and the CPU " +
"hardware to go idle");
instructionHelpList.add(jft10);
JTextArea jft11 = new JTextArea("Max consecutive cycles before idle (cycles) : Number of consecutive cycles of NOPs before the " +
"CPU goes idle");
instructionHelpList.add(jft11);
JTextArea jft12 = new JTextArea("EXECI execution : The number of clock cycles corresponding to an " +
"integer operation");
instructionHelpList.add(jft12);
JTextArea jft13 = new JTextArea("EXECC execution : The number of clock cycles corresponding to an " +
"operation on complex numbers");
instructionHelpList.add(jft13);
JTextArea jft14 = new JTextArea("Clock divider : This number defines the operating clock frequency of the CPU \n" +
"It is expressed via a number that is used to divide the global design\n" +
"frequency, whose default value is 200 MHz. Thus a clock divider equal to 4 means that the CPU\n" +
"operates at 200/4 = 50 MHz");
instructionHelpList.add(jft14);
JTextArea jft15 = new JTextArea("Encryption");
instructionHelpList.add(jft15);
JTextArea jft16 = new JTextArea("CPU Extension Construct");
instructionHelpList.add(jft16);
JTextArea jft17 = new JTextArea("Operation");
instructionHelpList.add(jft17);
HelpManager helpManager = new HelpManager();
if(helpManager.loadEntries()) {
helpEntries = new ArrayList<>();
HelpEntry he0 = helpManager.getHelpEntryWithHTMLFile("cpuname.html");
helpEntries.add(he0);
HelpEntry he1 = helpManager.getHelpEntryWithHTMLFile("schedulingpolicy.html");
helpEntries.add(he1);
HelpEntry he2 = helpManager.getHelpEntryWithHTMLFile("slicetime.html");
helpEntries.add(he2);
HelpEntry he3 = helpManager.getHelpEntryWithHTMLFile("numbercores.html");
helpEntries.add(he3);
HelpEntry he4 = helpManager.getHelpEntryWithHTMLFile("datasize.html");
helpEntries.add(he4);
HelpEntry he5 = helpManager.getHelpEntryWithHTMLFile("pipelinesize.html");
helpEntries.add(he5);
HelpEntry he6 = helpManager.getHelpEntryWithHTMLFile("taskswitchingtime.html");
helpEntries.add(he6);
HelpEntry he7 = helpManager.getHelpEntryWithHTMLFile("misbrandingprediction.html");
helpEntries.add(he7);
HelpEntry he8 = helpManager.getHelpEntryWithHTMLFile("cachemiss.html");
helpEntries.add(he8);
HelpEntry he9 = helpManager.getHelpEntryWithHTMLFile("goidletime.html");
helpEntries.add(he9);
HelpEntry he10 = helpManager.getHelpEntryWithHTMLFile("maxconsecutivecycles.html");
helpEntries.add(he10);
HelpEntry he11 = helpManager.getHelpEntryWithHTMLFile("execi.html");
helpEntries.add(he11);
HelpEntry he12 = helpManager.getHelpEntryWithHTMLFile("execc.html");
helpEntries.add(he12);
HelpEntry he13 = helpManager.getHelpEntryWithHTMLFile("clockdivider.html");
helpEntries.add(he13);
HelpEntry he14 = helpManager.getHelpEntryWithHTMLFile("encryption.html");
helpEntries.add(he14);
HelpEntry he15 = helpManager.getHelpEntryWithHTMLFile("operation.html");
helpEntries.add(he15);
HelpEntry he16 = helpManager.getHelpEntryWithHTMLFile("cpuextension.html");
helpEntries.add(he16);
}
for(int i = 0; i < instructionHelpList.size(); i++) {
for(int i = 0; i < 17; i++) {
Icon myIcon = IconManager.imgic32;
JButton but = new JButton(myIcon);
setButton(but);
buttonClick(but,helpEntries.get(i),helpManager);
buttons.add(but);
instructionHelpList.get(i).setEditable(false);
}
for (int i = 0; i < instructionHelpList.size(); i++) {
buttonClick(buttons.get(i),instructionHelpList.get(i));
}
}
private void initComponents() {
hardwareHelp();
Container c = getContentPane();
GridBagLayout gridbag0 = new GridBagLayout();
GridBagLayout gridbag2 = new GridBagLayout();
......@@ -237,7 +208,6 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
//GridBagConstraints c1 = new GridBagConstraints();
GridBagConstraints c2 = new GridBagConstraints();
GridBagConstraints c4 = new GridBagConstraints();
hardwareHelp();
setFont(new Font("Helvetica", Font.PLAIN, 14));
c.setLayout(gridbag0);
......@@ -290,7 +260,7 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
c2.weighty = 0.5;
c2.weightx = 0.5;
c2.gridwidth = GridBagConstraints.REMAINDER;
panel2.add(buttons.get(1),c2);
panel2.add(buttons.get(1),c2);
c2.gridwidth = 1;
//issue 183
......
##Cahe-miss
The percentage of cache misses
\ No newline at end of file
CPU Extension Construct
\ No newline at end of file
The CPU node name
\ No newline at end of file
## Data size
The size of an EXECI/EXECC operation, in number of bytes
\ No newline at end of file
Encryption
\ No newline at end of file
##EXECC execution
The number of clock cycles corresponding to an operation on complex numbers
\ No newline at end of file
##EXECI execution
The number of clock cycles corresponding to an integer operation
\ No newline at end of file
Go idle time (cycles) : The time taken by the OS and the CPU hardware to go idle
\ No newline at end of file
......@@ -3,8 +3,26 @@
- diplodocus diplodocus hardware software partitioning dse design space exploration
-- architecture architecture hardware os operating system
--- cpu cpu processor cpu os
----cpuname cpu_name cpu name
----schedulingpolicy scheduling_policy scheduling policy cpu
----slicetime slice_time slice time cpu
----numbercores number_of_core number core cpu
----datasize data_size data size cpu
----pipelinesize pipeline_size pipeline size cpu
----taskswitchingtime task_switching_time task switching time cpu
----misbrandingprediction mis-branding_prediction mis branding prediction cpu
----cachemiss cache_miss cache miss cpu
----goidletime go_idle_time go idle time cpu
----maxconsecutivecycles max_consecutive_cycles_before_idle max consecutive cycles before idle cpu
----execi execi_execution_time execi execution time cpu
----execc execc_execution_time execc execution time cpu
----clockdivider clock_divider clock divider cpu
-- mapping mapping tasks communication mapping
----encryption encryption encryption cpu
----operation operation operation cpu
----cpuextension cpu_extension_construct cpu extension construct
-- mapping mapping tasks communication mapping
---taskmapping taskmapping tasks mapping
---communicationmapping communicationmapping communication mapping
- avatar avatar software embedded systems safety security
......
##Max consecutive cycles before idle (cycles)
Number of consecutive cycles of NOPs before the CPU goes idle
\ No newline at end of file
##Mis-branching prediction
The miss percentage of the CPU branch prediction scheme
\ No newline at end of file
## Nb of Cores
The number of cores of the CPU
\ No newline at end of file
Operation
\ No newline at end of file
## Pipeline size
The number of stages of the pipeline
\ No newline at end of file
The arbitration policy used by OS to schedule mapped tasks
\ No newline at end of file
## slice time
The maximum time allocated by the OS scheduler to execute a task
\ No newline at end of file
##Task switching time
The time taken by the OS for a context switch
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment