Skip to content

Instantly share code, notes, and snippets.

set IO_LENGTH 180
set BONDPAD_SIZE 70
# sg13g2_io.lef defines sg13g2_ioSite for the sides, but no corner site
make_fake_io_site -name sg13g2_ioCSite -width $IO_LENGTH -height $IO_LENGTH
# Create IO Rows
make_io_sites \
-horizontal_site sg13g2_ioSite \
-vertical_site sg13g2_ioSite \
@jpf91
jpf91 / top.v
Created May 23, 2025 12:45
Verilog top-level for counter with IO pads
module top (
output wire p_count3,
output wire p_count2,
output wire p_count1,
output wire p_count0,
input wire p_clk,
input wire p_rst
);
wire clk, rst;
@jpf91
jpf91 / counter.vhd
Created May 23, 2025 11:21
Simple counter in VHDL
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity Counter is
port (
clk: in std_logic;
rst: in std_logic;
count: out std_logic_vector(3 downto 0)
);
@jpf91
jpf91 / oscillator.v
Created May 23, 2025 09:45
Saw wave generator
/*
* Saw wave generator
*/
module oscillator(
input clk,
input rstn,
input[11:0] count_max,
output[7:0] data
);
// Send 8 bit data to FPGA on Upduino via SPI
// See https://jpfau.org/blog/upduino-usb-spi/ for details and FPGA sample application.
// compile like this: g++ upduino_spi.cpp -o upduino_spi -lftdi1 `pkg-config libftdi1 --cflags`
#include <ftdi.h>
#include <unistd.h>
#include <stdexcept>
#include <string.h>
using std::string;
blueprint:
name: Window Open, Notify HomeMatic CCU
description: >
An automation blueprint that reduces the set temperature of your climate
device or group if a window sensor is open for more than the preset wait time.
It uses the Homematic window sensor channel to set the temperature to the "Open-window
temperature" set in the device configuration. You should set the "Mode for temperature
fall detection" to Inactive to avoid conflicts. It waits until the window is closed
again in order to restore the climate entity temperature. It has an optional blocking
entity to prevent the automation running unnecessarily, for example during the
blueprint:
name: Motion-activated Night Light
description: Turn on a light when motion is detected and it's night
domain: automation
input:
motion_entity:
name: Motion Sensor
selector:
entity:
domain: binary_sensor
import std.meta, std.traits;
version = DebugPrint;
version (DebugPrint)
{
import std.experimental.logger;
alias log = infof;
extern(C) uint _currTime()
{
@jpf91
jpf91 / fsm.d
Created March 7, 2020 13:17
D test FSM
import std.meta, std.traits;
version = DebugPrint;
version (DebugPrint)
{
import std.experimental.logger;
alias log = infof;
extern(C) uint _currTime()
{
diff -ur gcc-8-20171210.old/gcc/config/aarch64/aarch64.c gcc-8-20171210.new/gcc/config/aarch64/aarch64.c
--- gcc-8-20171210.old/gcc/config/aarch64/aarch64.c 2017-12-07 19:43:40.000000000 +0100
+++ gcc-8-20171210.new/gcc/config/aarch64/aarch64.c 2018-02-04 21:02:13.337405884 +0100
@@ -132,8 +132,8 @@
#define TARGET_HAVE_TLS 1
#endif
-static bool aarch64_composite_type_p (const_tree, machine_mode);
-static bool aarch64_vfp_is_call_or_return_candidate (machine_mode,
+bool aarch64_composite_type_p (const_tree, machine_mode);