Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define STACK_MIN_SIZE 32
union Datum {
uint8_t lo, hi;
uint16_t uint;
};
%
% First version of constraint model for add-example on alu-rf configuration
%
include "globals.mzn";
int: N = 10;
int: vregs = 3;
int: buses = 2;
int: registers = 3;
include "globals.mzn";
% Upper bound on #cycles
int: N = 10;
% Configuration
int: vregs = 1;
int: buses = 1;
int: registers = 1;
% B = array3d(1..10, 1..1, 1..1, [false, true, false, false, false, false, false, false, false, false]);
B:
false
true
false
false
% B = array3d(1..10, 1..1, 1..1, [false, false, false, false, false, false, false, false, true, true]);
B:
false
false
false
false
include "globals.mzn";
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Model Settings
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Upper bound on #cycles
int: N = 5;
In modern embedded systems, energy efficiency is one of the most important
design aspects. As there is only limited energy available per battery-life
cycle, the amount of computation that can be performed is heavily constrained.
General purpose processors provide high programmability at a high level of
abstraction, but this comes at a cost of lower performance, lower energy
efficiency or both.
In contrast, Application Specific Integrated Circuits (\textsc{ASIC}s) can offer
high performance at a high energy efficiency, but the operations performed by an
ASIC are fixed in hardware so flexibility is lacking. Since time-to-market is
;; Binary tree
(cl-defstruct tree
(left nil)
(right nil)
(value nil)
(comparator #'<))
(cl-defun tree-insert (tree val &optional (comparator #'<))
(cond
(setf triangle
[[75]
[95 64]
[17 47 82]
[18 35 87 10]
[20 04 82 47 65]
[19 01 23 75 03 34]
[88 02 77 73 07 63 67]
[99 65 04 28 06 16 70 92]
[41 41 26 56 83 40 80 70 33]
(defun calculate-row (triangle row)
(assert (< row (1- (length triangle))) t)
(let* ((toprow (aref triangle row))
(botrow (aref triangle (1+ row)))
(sumvec (make-vector (length toprow) 0)))
(dotimes (i (length toprow))
(setf (aref sumvec i) (max (+ (aref toprow i) (aref botrow i))
(+ (aref toprow i) (aref botrow (1+ i))))))
sumvec))