A visual and interactive systolic array simulator for matrix multiplication, built with React and TypeScript. This simulator helps visualize how data flows through systolic arrays, commonly used in neural network accelerators like Google's TPU.
- Interactive step-by-step visualization of systolic array computation
- Support for custom input and weight matrices
- Visual representation of MAC units and data flow
- Animation phases: init, update, translate, idle
- Configurable array size and animation speed
- Debug mode for detailed state inspection
import SystolicSimulator from './SystolicSimulator';
function MyComponent() {
return (
<SystolicSimulator
size={2}
debug={false}
animation_speed={2000}
/>
);
}
size
(number, default: 2): Size of the systolic array (NxN)debug
(boolean, default: false): Enable debug mode with step controlsifmap_buf
(number[][], optional): Input feature map matrixweight_buf
(number[][], optional): Weight matrixfrozen
(boolean, default: true): Freeze animation statefrozen_state
('init' | 'update' | 'translate' | 'idle', default: 'init'): Initial animation statestep_count
(number, default: 0): Initial step countlooping
(boolean, default: false): Enable continuous animationanimation_speed
(number, default: 2000): Animation speed in milliseconds
const inputMatrix = [
[1.0, 2.0],
[2.0, 1.0]
];
const weightMatrix = [
[1.0, 0.0],
[0.0, 1.0]
];
function MyAdvancedComponent() {
return (
<SystolicSimulator
size={2}
debug={true}
ifmap_buf={inputMatrix}
weight_buf={weightMatrix}
animation_speed={1500}
/>
);
}
SystolicSimulator
: Main component that orchestrates the simulationInputMatrix
: Handles input and weight matrix visualizationMACUnit
: Individual multiply-accumulate unitMACUnitGrid
: Grid layout for MAC unitsOutputMatrix
: Displays computation resultsRoundedArrow
: Visualizes data flow between units
MIT License with Citation Requirement
Copyright (c) 2025 William Pan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
Any academic or technical publications that use or reference this software must cite:
Pan, William. (2025). Systolic Array Simulator. GitHub Repository. https://github.com/wp4032/william-pan.com
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Contributions are welcome! Please feel free to submit a Pull Request.