This document is just scratch notes for a plugin for Bevy to manage a block-type world like in Minecraft.
This plugin, to be useful, must provide a number of things.
- Ability to create, damage, and destroy blocks in an aligned grid.
from amaranth import * | |
from amaranth.lib.coding import * | |
from numpy import log2, ceil | |
# FIXME: New Amaranth release indicates we should be deriving from Component, not | |
# Elaboratable | |
class MyCore(Elaboratable): | |
def __init__(self): | |
self.clock = Signal(1) |
with FSM(): | |
with m.State("Begin"): | |
with m.If(self.strobe): | |
m.next = "Process" | |
with m.State("Process"): | |
# Automatically create pipe.mult, pipe.shift | |
with m.Pipeline([self.mult, self.shift]) as pipe: | |
with pipe.Stage(): | |
# manually set up pipe.xor |
# Python 3.10 required | |
import numpy as np | |
from numpy import pi, sin, tan | |
from typing import Optional | |
import matplotlib.pyplot as plt | |
import scipy.fft as fft | |
class FilterModes: | |
DSVF_CHAMBERLIN = 'Chamberlin' | |
DSVF_LAZZARINI_TIMONEY = 'Lazzarini-Timoney' |
`default_nettype uwire | |
interface ICORDIC | |
#( | |
parameter width=40 // 48 max | |
) | |
( | |
wire logic [width-1:0] x, | |
wire logic [width-1:0] y, | |
wire logic [width-1:0] z, |
+----------------------------------------------+
| /| |
| +------------------------->| | |
| +----+ | /| +----->| |---+
+--->| | | | |--->Acc1 | +--->| |
|Op 1|---+--->| |--->Acc2 | | \|
+----+ | | |--->Acc3 | |
+-----------+ \| | |
| | |
| +-------------------+ |
An attempt to explain step-by-step how FM synthesis calculation works.
Using the OPL3 as an example, there are several components:
Ordered preferences X≻A → if X is not a candidate, voter votes for A
14: Alex≻Bobbie≻Chris≻Dane \
12: Bobbie≻Alex≻Chris≻Dane | ← 51% majority, doesn't count.
25: Chris≻Bobbie≻Alex≻Dane /
49: Dane≻Chris≻Bobbie≻Alex ← Most votes, wins plurality
Instant runoff voting:
// Not valid | |
namespace Boilerplate | |
{ | |
public boilerplate BCompareOperators<T> | |
{ | |
bool operator >(T lhs, T rhs) => lhs.CompareTo(rhs) > 0; | |
bool operator <(T lhs, T rhs) => lhs.CompareTo(rhs) < 0; | |
bool operator >=(T lhs, T rhs) => lhs.CompareTo(rhs) >= 0; | |
bool operator <=(T lhs, T rhs) => lhs.CompareTo(rhs) <= 0; |