Skip to content

Instantly share code, notes, and snippets.

View mattbettcher's full-sized avatar

Matthew Bettcher mattbettcher

  • Tidal Wave Innovations
  • United States
View GitHub Profile
@mattbettcher
mattbettcher / main.rs
Created August 11, 2020 16:47
Very hacky vcd output.
use kaze::*;
use vcd::*;
use std::io;
use std::{fs::File, io::ErrorKind::InvalidInput};
fn main() -> std::io::Result<()> {
let mut file = File::create("foo.vcd")?;
// Create a context, which will contain our module(s)
let c = Context::new();
@mattbettcher
mattbettcher / main.rs
Created August 7, 2016 15:20
Problem with Tuples and Function Pointers in Rust
extern crate regex;
use regex::Regex;
macro_rules! mask_shift {
($v: ident, $m: expr, $s: expr) => {
(($v as u32 & $m as u32) >> $s) as u32
}
}