Creative Commons Attribution 4.0 International License |cc_by_40_logo|.
This file contains hidden or 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
LIB_NAME = my_lib | |
SOURCES = my_lib.c | |
$(LIB_NAME).so: $(SOURCES) | |
gcc -O2 -shared -o $(LIB_NAME).so $(SOURCES) |
This file contains hidden or 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
#define _GNU_SOURCE | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <signal.h> | |
#include <string.h> | |
volatile int running = 1; |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <signal.h> | |
#define FIFO_FILE "/tmp/veri.log" | |
#define TERM_EMU_CMD "xterm -e 'cat /tmp/veri.log'" |
This file contains hidden or 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
vunit unary_counter_prop(unary_counter(unary_counter_arch)) { | |
constant all_zeros : std_logic_vector(LENGTH-1 downto 0) := (others => '0'); | |
constant all_ones : std_logic_vector(LENGTH-1 downto 0) := (others => '1'); | |
default clock is rising_edge(clk); | |
-- | |
-- Check for counter code is a unary code | |
-- | |
signal f_check_out: std_logic_vector(LENGTH-1 downto 0) := all_zeros; |
This file contains hidden or 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
const std = @import("std"); | |
const CrossTarget = @import("std").zig.CrossTarget; | |
const Target = @import("std").Target; | |
const Feature = @import("std").Target.Cpu.Feature; | |
pub fn build(b: *std.Build) void { | |
const features = Target.riscv.Feature; | |
var disabled_features = Feature.Set.empty; | |
var enabled_features = Feature.Set.empty; |
This file contains hidden or 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
#!/usr/bin/env guile | |
!# | |
;; -*- geiser-scheme-implementation: guile -*- | |
(import (ice-9 textual-ports) ; read port by lines | |
(srfi srfi-1) ; lists | |
(srfi srfi-11) ; let-values | |
(srfi srfi-13) ; strings | |
(srfi srfi-26) ; cut |
This file contains hidden or 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
import pygame | |
import numpy as np | |
# Import pygame.locals for easier access to key coordinates | |
from pygame.locals import ( | |
K_UP, | |
K_DOWN, | |
K_LEFT, | |
K_RIGHT, | |
K_ESCAPE, |
This file contains hidden or 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
`timescale 1ps/1ps | |
`default_nettype none | |
module seq #(parameter SEQUENCE = "") | |
(input wire clock, | |
output reg out); | |
int l, n; | |
string s; |
This file contains hidden or 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
# To run formal verification call SymbiYosys: | |
# $ sby -f onehot_detector.sby | |
[options] | |
mode prove | |
[engines] | |
smtbmc yices | |
[script] |
NewerOlder