This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A match is needed for this to work | |
.fu_\(.*\)_hwdata (@"(if (equal vl-dir \\"output\\") \\"\\" (concat \\"{\\" (concat vl-width \\"{1'b0}}\\")))"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#+TITLE: Example of using org/babel to do litterate programming | |
#+AUTHOR: Ronan BARZIC | |
#+EMAIL: ronan.barzic@onio.com | |
To "tangle" it : C-c C-v t | |
#+BEGIN_SRC python :noweb yes :tangle HelloWorld.py :exports none | |
"""This is a hello world example document""" | |
# imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From https://groups.google.com/a/groups.riscv.org/d/msg/isa-dev/fONrcF2lxhQ/sb2ZN5Q_AQAJ | |
rohan:2183$ cat tmp.c | |
int | |
sub (int a, int b) | |
{ | |
int result; | |
asm (".insn r 0x33, 0, 0, %0, %1, %2" : "=r" (result) : "r" (a), "r" (b)); | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
perl -p -i -e "s/$(ORIGINAL_STRING)/$(NEW_STRING)/g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ahb_bridge_\([a-z0-9]+\)(amlimain_togdr_\1@"vl-bits"), | |
.bridge_ahb_\([a-z0-9]+\)(togdr_amlimain_\1@"vl-bits"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AutoVivification(dict): | |
"""Implementation of perl's autovivification feature.""" | |
def __getitem__(self, item): | |
try: | |
return dict.__getitem__(self, item) | |
except KeyError: | |
value = self[item] = type(self)() | |
return value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From https://stackoverflow.com/questions/5369723/multi-level-defaultdict-with-variable-depth/8702435#8702435 | |
from collections import defaultdict | |
nested_dict = lambda: defaultdict(nested_dict) | |
nest = nested_dict() | |
nest[0][1][2][3][4][5] = 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////// | |
// Bus Interface Unit | |
// It is assumed that the BIU has internal registers, and will | |
// latch address, operation, and write data on rising clock edge | |
// when strobe is asserted | |
// We implement a glitch filter.... | |
wire biu_clr_err_dly; | |
wire biu_clr_err_filtered; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ORIGINAL_IP=Nrv32Sig | |
TARGET_IP=ssctrL | |
ORIGINAL_IP_LOWER = $(shell echo $(ORIGINAL_IP) | tr '[:upper:]' '[:lower:]') | |
TARGET_IP_LOWER = $(shell echo $(TARGET_IP) | tr '[:upper:]' '[:lower:]') | |
ORIGINAL_IP_UPPER = $(shell echo $(ORIGINAL_IP) | tr '[:lower:]' '[:upper:]') | |
TARGET_IP_UPPER = $(shell echo $(TARGET_IP) | tr '[:lower:]' '[:upper:]') | |
debug: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* XXXXXXXX AUTO_TEMPLATE( | |
.\(.*\) (@"(if (equal vl-dir \\"input\\") (concat vl-width \\"'b0\\") \\"\\" )"), | |
.\(.*\) (@"(if (equal vl-dir \\"output\\") \\"\\" (concat vl-width \\"'b0\\") )"), | |
); */ |
NewerOlder