Skip to content

Commit ddbef31

Browse files
committed
Merge branch 'master' into feature/qt6
2 parents 0afafa7 + 1ae2002 commit ddbef31

66 files changed

Lines changed: 363 additions & 107 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,19 @@ All notable changes to this project will be documented in this file.
44
## [Unreleased]
55
* updated to Qt major version 6 comes with a lot of code fixes
66
* added information to GUI setting file so that widgets position and size from previous session gets restored
7+
* added option to focus on pin in pin context menu
8+
* changed default order to 'descending' when creating a pin group via Python command
9+
* module pin groups
10+
* fixed bug in pin model which must not crash when deleting a non-empty pin group
11+
* fixed bug by disallowing deletion of group comprising a single pin with same name
712
* plugins
13+
* simulation
14+
* added feature, selecting a waveform in viewer selects net in graph view as well
15+
* fixed bug in waveform viewer, make sure that deleting a controller causes closing the tab
16+
* added 'hover over node' feature in dot viewer
17+
* fixed broken initialization of DANA plugin when starting via CLI
818
* changed behavior of GUI plugin manager to keep only those plugins loaded which are requested by user
9-
* fixed a bug in the bitorder propagation algorithm that would assign a wrong propagation order if pingroups with direction none were given as parameters
19+
* fixed bug in the bitorder propagation algorithm that would assign a wrong propagation order if pingroups with direction none were given as parameters
1020

1121
## [4.5.0](v4.5.0) - 2025-09-23 12:00:00+02:00 (urgency: medium)
1222
* plugins

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,18 @@ For instructions on how to build HAL, please refer to the dedicated page in our
6060
# Quickstart Guide
6161

6262
Install HAL or build HAL and start the GUI via `hal -g`. You can list all available options via `hal [--help|-h]`.
63-
We included some example netlists in `examples` together with the implementation of the respective example gate library in `plugins/example_gate_library`.
63+
We included some example projects in `examples` subdirectory. To get startet with an example project you need to import
64+
it via `Import Project` from main menu or by dropping the zipped file in the `OPEN PROJECT` area of the Welcome Screen.
65+
Doing so a popup will request a directory with write permissions where HAL will create the project directory and uncompress
66+
the files. Do not use external tools for uncompress since adaptions are made so that netlist and gate library
67+
are found the next time the project gets opened.
68+
69+
In case you want to open your own Verlog or VHDL netlist you have to run `Import Netlist` instead. This will only work if
70+
there is a matching gate library in `plugins/gate_libraries/definitions` or you provide the gate library manually.
6471
For instructions to create your own gate library and other useful tutorials, take a look at the [wiki](https://github.com/emsec/hal/wiki).
6572

66-
Load a library from the `examples` directory and start exploring the graphical representation.
73+
The following example code refers to the `fsm` example.
74+
6775
Use the integrated Python shell or the Python script window to interact. Both feature (limited) autocomplete functionality.
6876

6977
Let's list all lookup tables and print their Boolean functions:

documentation/hal_screenshot.html

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,22 @@
3434
counter-increment: item;
3535
margin-bottom: 8px;
3636
}
37-
li:before {
38-
margin-right: 10px;
37+
li::before {
3938
content: counter(item);
39+
margin-right: 10px;
40+
4041
background: red;
41-
font-weight: 900;
42-
border-radius: 100%;
4342
color: white;
44-
width: 2.2em;
45-
height: 2.2em;
46-
text-align: center;
47-
display: inline-block;
43+
font-weight: 1600;
44+
45+
width: 1.8em;
46+
height: 1.8em;
47+
border-radius: 50%;
48+
49+
font-size: 2.2em;
50+
display: inline-flex;
51+
align-items: center;
52+
justify-content: center;
4853
}
4954
</style>
5055
</head>
@@ -69,6 +74,11 @@ <h1>HAL Screenshot</h1>
6974
<li><a href="https://github.com/emsec/hal/wiki/waveform-viewer-widget" target="_blank">Waveform Viewer</a></li>
7075
<li><a href="https://github.com/emsec/hal/wiki/python-console-widget" target="_blank">Python Console</a></li>
7176
<li><a href="https://github.com/emsec/hal/wiki/log-widget" target="_blank">Log Messages</a></li>
77+
<li><a href="https://github.com/emsec/hal/wiki/dot-graph-viewer" target="_blank">Dot Graph Viewer</a></li>
7278
</ol></p>
79+
80+
<a href="https://github.com/emsec/hal/wiki/dot-graph-viewer" target="_blank">
81+
<img src="https://raw.githubusercontent.com/emsec/hal/master/wiki_images/dot_viewer/widget.png"/>
82+
</a>
7383
</body>
7484
</html>

documentation/hal_screenshot.svg

Lines changed: 2 additions & 2 deletions
Loading

examples/crypto_trojan.zip

-1.42 KB
Binary file not shown.

include/hal_core/netlist/module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ namespace hal
518518
const std::vector<ModulePin*> pins = {},
519519
PinDirection direction = PinDirection::none,
520520
PinType type = PinType::none,
521-
bool ascending = true,
521+
bool ascending = false,
522522
u32 start_index = 0,
523523
bool delete_empty_groups = true,
524524
bool force_name = false);

plugins/dataflow_analysis/src/api/result.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ namespace hal
283283
write_path /= "graph.dot";
284284
}
285285

286-
if (write_path.extension() != "dot")
286+
if (write_path.extension() != ".dot")
287287
{
288288
log_info("dataflow", "replacing invalid file extension '{}' with '.dot' ...", write_path.extension().string());
289289
write_path.replace_extension("dot");
@@ -357,7 +357,7 @@ namespace hal
357357
write_path /= "groups.txt";
358358
}
359359

360-
if (write_path.extension() != "txt")
360+
if (write_path.extension() != ".txt")
361361
{
362362
log_info("dataflow", "replacing invalid file extension '{}' with '.txt' ...", write_path.extension().string());
363363
write_path.replace_extension("txt");

plugins/dataflow_analysis/src/plugin_dataflow.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ namespace hal
6262
UNUSED(args);
6363

6464
dataflow::Configuration config(nl);
65+
config.with_control_pin_types({PinType::clock, PinType::enable, PinType::reset, PinType::set});
66+
config.with_gate_types({GateTypeProperty::ff});
67+
6568
std::string path;
6669

6770
if (args.is_option_set("--path"))
@@ -103,6 +106,19 @@ namespace hal
103106
return false;
104107
}
105108

109+
if (!path.empty())
110+
{
111+
auto grouping = grouping_res.get();
112+
if (const auto res = grouping.write_dot(path); res.is_error())
113+
{
114+
log_error("dataflow", "could not write .dot file:\n{}", res.get_error().get());
115+
}
116+
if (const auto res = grouping.write_txt(path); res.is_error())
117+
{
118+
log_error("dataflow", "could not write .txt file:\n{}", res.get_error().get());
119+
}
120+
}
121+
106122
return true;
107123
}
108124

plugins/dot_viewer/deps/QGVCore/QGVEdge.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ License along with this library.
2323
#include <QDebug>
2424
#include <QPainter>
2525

26-
QGVEdge::QGVEdge(QGVEdgePrivate *edge, QGVScene *scene) : _scene(scene), _edge(edge), _head_node(nullptr), _tail_node(nullptr)
26+
QGVEdge::QGVEdge(QGVEdgePrivate *edge, QGVScene *scene) : _scene(scene), _edge(edge), _head_node(nullptr), _tail_node(nullptr), mHover(false)
2727
{
2828
setFlag(QGraphicsItem::ItemIsSelectable, true);
2929
}
@@ -44,12 +44,14 @@ QRectF QGVEdge::boundingRect() const
4444
return _path.boundingRect() | _head_arrow.boundingRect() | _tail_arrow.boundingRect() | _label_rect;
4545
}
4646

47-
void QGVEdge::setEndpoints(const QHash<void*,QGVNode*>& nodeHash)
47+
void QGVEdge::setEndpoints(const QHash<void *, QGVNode *> &nodeHash, QMultiMap<QGVNode *, QGVEdge *>& attachedEdges)
4848
{
4949
auto agHead = _edge->endpoint(true);
5050
if (agHead) _head_node = nodeHash.value(agHead, nullptr);
51+
attachedEdges.insert(_head_node, this);
5152
auto agTail = _edge->endpoint(false);
5253
if (agTail) _tail_node = nodeHash.value(agTail, nullptr);
54+
attachedEdges.insert(_tail_node, this);
5355
}
5456

5557
QGVNode* QGVEdge::headNode() const
@@ -82,6 +84,12 @@ void QGVEdge::setHightlight(const QString& hilight)
8284
update();
8385
}
8486

87+
void QGVEdge::setHover(bool hover)
88+
{
89+
mHover = hover;
90+
update();
91+
}
92+
8593
void QGVEdge::paintText(QPainter* painter)
8694
{
8795
int pos = _highlight_text.isEmpty() ? -1 : _label.indexOf(_highlight_text);
@@ -106,15 +114,15 @@ void QGVEdge::paintText(QPainter* painter)
106114
if (count % 2 > 0)
107115
{
108116
// highlight
109-
tpen.setColor(QGVStyle::instance()->penColor(true,_pen.color()));
117+
tpen.setColor(QGVStyle::instance()->penColor(true,mHover,_pen.color()));
110118
lastPos = pos + _highlight_text.size();
111119
part = _label.mid(pos, lastPos-pos);
112120
pos = _label.indexOf(_highlight_text, lastPos);
113121
}
114122
else
115123
{
116124
// normal
117-
tpen.setColor(QGVStyle::instance()->penColor(false,_pen.color()));
125+
tpen.setColor(QGVStyle::instance()->penColor(false,mHover,_pen.color()));
118126
int len = pos < 0 ? _label.size() - lastPos : pos - lastPos;
119127
if (len > 0) part = _label.mid(lastPos,len);
120128
}
@@ -134,7 +142,7 @@ void QGVEdge::paint(QPainter * painter, const QStyleOptionGraphicsItem *, QWidge
134142
painter->save();
135143

136144
QPen tpen(_pen);
137-
tpen.setColor(QGVStyle::instance()->penColor(isSelected(),_pen.color()));
145+
tpen.setColor(QGVStyle::instance()->penColor(isSelected(),mHover,_pen.color()));
138146
tpen.setWidth(isSelected() ? 2 : 1);
139147
painter->setPen(tpen);
140148

plugins/dot_viewer/deps/QGVCore/QGVEdge.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ class QGVCORE_EXPORT QGVEdge : public QGraphicsItem
4848

4949
void updateLayout();
5050

51-
void setEndpoints(const QHash<void*,QGVNode*>& nodeHash);
51+
void setEndpoints(const QHash<void*, QGVNode*>& nodeHash, QMultiMap<QGVNode*, QGVEdge*>& attachedEdges);
5252

5353
void setHightlight(const QString& hilight);
5454

55+
void setHover(bool hover);
56+
5557
QGVNode* headNode() const;
5658
QGVNode* tailNode() const;
5759

@@ -86,6 +88,8 @@ class QGVCORE_EXPORT QGVEdge : public QGraphicsItem
8688
QGVNode* _tail_node;
8789

8890
QString _highlight_text;
91+
92+
bool mHover;
8993
};
9094

9195
#endif // QGVEDGE_H

0 commit comments

Comments
 (0)