Skip to content

Instantly share code, notes, and snippets.

View ThomasHornschuh's full-sized avatar

Thomas Hornschuh ThomasHornschuh

View GitHub Profile
@ThomasHornschuh
ThomasHornschuh / init.py
Last active August 3, 2020 17:37
MyHDL Init Problem
from __future__ import print_function
from myhdl import *
@block
def unit(clock,reset):
ip = Signal(intbv(0xc0000000)[32:])
@ThomasHornschuh
ThomasHornschuh / jekill.sh
Created April 26, 2020 18:52
Jekyll install and run quick start
#Setup
sudo apt-get install ruby-full
gem update bundler
sudo gem install bundler
#goto suitable directory (e.g $HOME/development)
mkdir jekyll
cd jekyll
git clone git@github.com:bonfireprocessor/bonfireprocessor.github.io.git
sudo fallocate -l 16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
CAPI=1
[main]
name = ::bonfire-soc-io:0
depend = ::bonfire-util:0 ::zpuino-uart:0 ::bonfire-spiflash:0 ::bonfire-gpio:0
backend = ise
simulators=ghdl isim
[fileset rtl]
files = gpio.vhd io_intercon.vhd bonfire_soc_io.vhd
file_type=vhdlSource
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 17:33:05 12/22/2015
-- Design Name:
-- Module Name: fontrom - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
@ThomasHornschuh
ThomasHornschuh / sanitize_url.lua
Last active October 20, 2019 09:08
Sanitize and parse URL in Lua
function sanitize_url(url)
if url:match("[%s%c]") then
error "url contains spaces or ctrl chars"
end
local proto,tail=url:match('^(%a+)://(.+)')
if not proto then
tail=url
proto="http"
from tb import tb_barrel_shifter
def test(inst,**kwagrs):
inst.config_sim(**kwagrs)
inst.run_sim()
inst.quit_sim()
def testx(inst,**kwagrs):
from myhdl import Simulation,traceSignals
@ThomasHornschuh
ThomasHornschuh / tcp.log
Created March 26, 2019 19:16
Picotcp tcp log in Bonfire eLua
setsockopt: Nagle algorithm enabled.
Sending SYN... (ports: 2696 - 4000) size: 78
Sending empty packet
pico_tcp_process_out: non-pure ACK with len=0, fl:0002
[sam] TCP> [tcp input] t_len: 40
[sam] TCP> flags = 0x12
[sam] TCP> s->state >> 8 = 3
[sam] TCP> [tcp input] socket: 0xa26b8 state: 3 <-- local port:2696 remote port: 4000 seq: 0x3352a6f1 ack: 0xabcfafc2 flags: 0x12 t_len: 40, hdr: 40 payload: 0
Mode: Look-ahead. In flight: 0/2 buf: 0
-----=============== RTT CUR: 18 AVG: 18 RTTVAR: 9 RTO: 70 ======================----