This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width,initial-scale=1" /> | |
<title>Particles + von Mises stress demo</title> | |
<style> | |
html,body { height:100%; margin:0; background:#0b0b0b; color:#ddd; font-family:Helvetica,Arial; } | |
canvas { display:block; width:100vw; height:100vh; } | |
#ui { position: absolute; left:12px; top:12px; z-index:10; background:rgba(0,0,0,0.4); padding:8px; border-radius:6px; font-size:13px; } |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.19; | |
import "@openzeppelin/contracts/access/Ownable2Step.sol"; | |
import "@openzeppelin/contracts/utils/structs/BitMaps.sol"; | |
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; | |
// Note: Removed MerkleProof import as we're implementing a recursive verification function. | |
// Inspired by the Austrian School of Economics, this contract emphasizes decentralized verification | |
// and individual action in maintaining sequence integrity. |
This file contains hidden or 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
// OpenCL for FPGAs is already a form of HLS, similar to C/C++ HLS or MyHDL. | |
// The previous OpenCL kernel provided is suitable; it can be compiled with tools like Intel FPGA OpenCL SDK or Xilinx SDAccel/Vitis. | |
// For similarity to HLS/MyHDL, note that OpenCL kernels describe parallel hardware, like MyHDL modules or HLS functions with pragmas. | |
// No major changes needed, but here's an adjusted version with fixed-point for better FPGA fit. | |
// Adjusted Kernel | |
#define NUM_OSC 32 | |
#define PI 3.141592653589793f | |
#define AMP 0.06f | |
#define FIXED_WIDTH 16 |
This file contains hidden or 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
# MyHDL Python code for hardware description of the audio synthesizer. | |
# This generates Verilog/VHDL for FPGA. For sine, uses a LUT-based DDS. | |
# Frequency sweep implemented by linearly increasing phase increment. | |
# Host/CPU would generate random params, configure via registers. | |
# Assumes fixed-point, 16-bit output. Mixes 32 oscillators. | |
from myhdl import * | |
import math | |
def audio_synth(clk, reset, start_phase_inc, end_phase_inc, audio_out, sample_rate=44100, duration=60): |
This file contains hidden or 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
// Example Vitis HLS C++ code for synthesizing the audio generator to FPGA RTL. | |
// This is a top-level function that generates a buffer of mixed sine sweep samples. | |
// Host code (not shown) would generate random freqs, call the kernel via Vitis API, stream to audio. | |
// Use fixed-point for better FPGA efficiency; here using float for simplicity. | |
// Include <hls_math.h> for sinf(). | |
#include <hls_stream.h> | |
#include <hls_math.h> | |
#include <ap_fixed.h> |
This file contains hidden or 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
# PowerShell script to decrease fan speed and increase thermal dissipator speed | |
# Requires administrative privileges and compatible hardware/software | |
# Ensure the script runs with elevated privileges | |
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
Write-Error "This script requires administrative privileges. Please run as Administrator." | |
exit | |
} | |
# Function to set fan speed (example using WMI, adjust for your hardware) |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.19; | |
import "@openzeppelin/contracts/access/Ownable2Step.sol"; | |
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; | |
import "@openzeppelin/contracts/utils/structs/BitMaps.sol"; | |
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; | |
/// @title Advanced A336975 Sequence Storage with Batch Processing | |
/// @notice Implements a gas-efficient, verifiable storage for OEIS sequence A336975 |
This file contains hidden or 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
// OpenCL kernel for tone generator | |
__kernel void tone_generator(__global float *output, __global float *osc_freq, __global float *lfo_freq, __global float *phase, __global float *lfo_phase) { | |
const int NUM_OSC = 32; | |
const float SAMPLE_RATE = 48000.0f; | |
const float TWO_PI = 6.28318530718f; | |
const float AMPLITUDE = 0.01f; | |
// Get global ID for parallel processing | |
int gid = get_global_id(0); | |
float sum = 0.0f; |
This file contains hidden or 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
from myhdl import block, Signal, intbv, always_comb, always_seq, delay | |
import math | |
@block | |
def tone_generator(clk, reset, output): | |
# Parameters | |
NUM_OSC = 32 | |
SAMPLE_RATE = 48000 | |
TWO_PI = 2 * math.pi | |
BIT_WIDTH = 16 |
This file contains hidden or 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 <hls_math.h> | |
#include <ap_fixed.h> | |
// Define fixed-point types for FPGA efficiency | |
typedef ap_fixed<16, 4> fixed_t; // 16-bit fixed-point, 4 integer bits | |
const int NUM_OSC = 32; | |
const float SAMPLE_RATE = 48000.0; // Audio sample rate (Hz) | |
const float TWO_PI = 6.28318530718; | |
// Precomputed random frequencies and LFO rates (generated offline) |
NewerOlder