summaryrefslogtreecommitdiff
path: root/src/common.svh
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.svh')
-rw-r--r--src/common.svh2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common.svh b/src/common.svh
index 67a87d2..131a2ca 100644
--- a/src/common.svh
+++ b/src/common.svh
@@ -116,4 +116,6 @@ typedef enum op_t {
`define rn(r) (REG + port_t'(r))
`define alu(fu) (ALU + port_t'(fu))
+`define COUNTER(x) ((x) > 1 ? $clog2(x) : 1)
+
`endif /* __COMMON_SVH__ */