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
#include <stddef.h> | |
char get_first_cap(const char *in, int size) { | |
const char *first_cap = NULL; | |
if (size == 0) | |
return ' '; | |
for (int i = 0 ; i++ < size && *in != 0; in++) { | |
if (*in >= 'A' && *in <= 'Z') { | |
first_cap = in; |
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
with Ada.Command_Line; | |
with Ada.Text_IO; | |
procedure Hello_World is | |
You : constant String := | |
-- Change to strict inequality below to prove | |
(if Ada.Command_Line.Argument_Count >= 0 then | |
Ada.Command_Line.Argument (1) | |
else "世界"); | |
begin |
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
//! this program exists only to launch RPCS3, pointed to the Tekken Tag | |
//! Tournament 2 ROM on my hard drive, with Steam Remote Play. there are a very | |
//! weird set of circumstances leading to this: | |
//! | |
//! as a prerequisite: modern Steam supports a full userspace gamepad input | |
//! device stack, called "Steam Input". games launched by steam have the Steam | |
//! Overlay injected into them, which also handles Steam Input. in effect, Steam | |
//! Input allows arbitrary gamepads, such as PS4 DualShocks or Nintendo Joycons, | |
//! or even exotic devices like Hitbox/PS4 Hori Fightpads, to be registered and | |
//! control mapped on the system, entirely through Steam and without any other |
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
# Setup compilation | |
set QSYS_SIMDIR ../prj | |
source $QSYS_SIMDIR/mentor/msim_setup.tcl | |
dev_com | |
com | |
# add sources, but skip the top level BSP since its unused | |
foreach f [glob -type f path/to/sources/*.sv] { | |
vlog -sv -work work "$f" | |
} |
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
#include <stdint.h> | |
#include <stddef.h> | |
#include <stdbool.h> | |
#ifndef __wasm__ | |
#define LLVM_MCA_BEGIN(l) __asm__ __volatile__("# LLVM-MCA-BEGIN " l); | |
#define LLVM_MCA_END(l) __asm__ __volatile__("# LLVM-MCA-END " l); | |
#else | |
#define LLVM_MCA_BEGIN(_) | |
#define LLVM_MCA_END(_) |
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
#! /usr/bin/env bluetcl | |
# bsc-libdir: a tcl script that looks up Verilog primitives for | |
# the bluespec compiler, and emits them to stdout. this tool | |
# is more useful when combined with `bsc-rpc`, but might be | |
# of use on its own. | |
# | |
# usage: | |
# | |
# $ bluetcl bsc-libdir RegUN > RegUN.v |
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
sim.exe: top.v sim.cpp | |
verilator --cc --coverage --exe -Wno-lint -trace --top-module top \ | |
--Mdir bench_dir $^ | |
$(MAKE) -C bench_dir -f Vtop.mk | |
cp bench_dir/Vtop $@ | |
clean: | |
rm -f bench_dir sim.exe | |
.PHONY: clean |
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
# ecp5pll.py: yosys RPC frontend for generating ECP5 PLL modules on the fly | |
# | |
# Copyright (C) 2020 Austin Seipp | |
# | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
# | |
# This program is free software: you can redistribute it and/or modify it under | |
# the terms of the GNU General Public License as published by the Free Software | |
# Foundation, either version 3 of the License, or (at your option) any later | |
# version. |
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
with import <nixpkgs> {}; | |
let | |
nextpnr-gui = pkgs.nextpnr; # gui by default on upstream | |
nextpnr-nogui = pkgs.nextpnr.override { enableGui = false; }; | |
common-pkgs = with pkgs; [ | |
symbiyosys yosys verilog verilator | |
icestorm trellis | |
z3 yices boolector |
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
#!/usr/bin/env bash | |
[ -z "$1" ] && echo "ERROR: must provide arg" && exit 1 | |
CACHE_URL=${CACHE_URL:-"https://cache.nixos.org"} | |
curl -v \ | |
-HFastly-Debug:1 \ | |
-o /dev/null 2>&1 \ | |
"$CACHE_URL/$1" \ |