aboutsummaryrefslogtreecommitdiffstats
path: root/manual/presentation.sh
blob: ca8a6c93c10af9f229ab7258799f380b6aa6b224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

fast_mode=false

set -- $(getopt fu "$@")
while [ $# -gt 0 ]; do
	case "$1" in
		-f)
			fast_mode=true
			;;
		--)
			shift
			break
			;;
		-*)
			echo "$0: error - unrecognized option $1" 1>&2
			exit 1
			;;
		*)
			break
	esac
	shift
done

PDFTEX_OPT="-shell-escape -halt-on-error"

set -ex

if ! $fast_mode; then
	! md5sum *.aux *.snm *.nav *.toc > autoloop.old
	make -C PRESENTATION_Intro
	make -C PRESENTATION_ExSyn
	make -C PRESENTATION_ExAdv
	make -C PRESENTATION_ExOth
	make -C PRESENTATION_Prog
fi

set -ex

pdflatex $PDFTEX_OPT presentation.tex

if ! $fast_mode; then
	while
		md5sum *.aux *.snm *.nav *.toc > autoloop.new
		! cmp autoloop.old autoloop.new
	do
		cp autoloop.new autoloop.old
		pdflatex $PDFTEX_OPT presentation.tex
	done

	rm -f autoloop.old
	rm -f autoloop.new
fi
#include <backends/cxxrtl/cxxrtl_capi.h> struct _cxxrtl_handle { std::unique_ptr<cxxrtl::module> module; cxxrtl::debug_items objects; }; // Private function for use by other units of the C API. const cxxrtl::debug_items &cxxrtl_debug_items_from_handle(cxxrtl_handle handle) { return handle->objects; } cxxrtl_handle cxxrtl_create(cxxrtl_toplevel design) { return cxxrtl_create_at(design, ""); } cxxrtl_handle cxxrtl_create_at(cxxrtl_toplevel design, const char *root) { std::string path = root; if (!path.empty()) { // module::debug_info() accepts either an empty path, or a path ending in space to simplify // the logic in generated code. While this is sketchy at best to expose in the C++ API, this // would be a lot worse in the C API, so don't expose it here. assert(path.back() != ' '); path += ' '; } cxxrtl_handle handle = new _cxxrtl_handle; handle->module = std::move(design->module); handle->module->debug_info(handle->objects, path); delete design; return handle; } void cxxrtl_destroy(cxxrtl_handle handle) { delete handle; } void cxxrtl_reset(cxxrtl_handle handle) { handle->module->reset(); } int cxxrtl_eval(cxxrtl_handle handle) { return handle->module->eval(); } int cxxrtl_commit(cxxrtl_handle handle) { return handle->module->commit(); } size_t cxxrtl_step(cxxrtl_handle handle) { return handle->module->step(); } struct cxxrtl_object *cxxrtl_get_parts(cxxrtl_handle handle, const char *name, size_t *parts) { auto it = handle->objects.table.find(name); if (it == handle->objects.table.end()) return nullptr; *parts = it->second.size(); return static_cast<cxxrtl_object*>(&it->second[0]); } void cxxrtl_enum(cxxrtl_handle handle, void *data, void (*callback)(void *data, const char *name, cxxrtl_object *object, size_t parts)) { for (auto &it : handle->objects.table) callback(data, it.first.c_str(), static_cast<cxxrtl_object*>(&it.second[0]), it.second.size()); } void cxxrtl_outline_eval(cxxrtl_outline outline) { outline->eval(); }