Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAR_ADC (Chile 2) #1

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a2134ec
Add files via upload
papijou2433 Oct 14, 2023
6ce6c94
Delete layout/gds directory
papijou2433 Oct 14, 2023
d9ea78b
SAR_ADC(Chile 1)
papijou2433 Oct 14, 2023
dc4f4d9
Delete SAR_ADC directory
papijou2433 Oct 14, 2023
ffd1428
SAR_ADC (Chile 2)
papijou2433 Oct 14, 2023
16acc2a
Update README.md
papijou2433 Oct 14, 2023
7d768c7
Delete SAR_ADC/gds directory
papijou2433 Oct 14, 2023
e7f6514
Add files via upload
papijou2433 Oct 14, 2023
7d303d0
Update README.md
papijou2433 Nov 11, 2023
74fb891
Add files via upload
papijou2433 Nov 11, 2023
bcc16db
Added top level simulation
Dec 7, 2023
22e6f88
Add updated comparator, update top, add sar logic, add openlane files
Dec 16, 2023
d2b27f7
Fix test with the PDK D variant
Dec 16, 2023
7b47cb9
Add comparator testbenches
Dec 18, 2023
327b297
Schematic file management update
VicenteOsorio Dec 22, 2023
00cfb5f
Fixed symbol paths for CDAC and TOP
VicenteOsorio Dec 22, 2023
7825044
Bootstrap symbol update
VicenteOsorio Jan 26, 2024
2577462
bottom plate sampling
gsuckz Jan 26, 2024
86ad125
Merge branch 'papijou2433-patch-1' of https://github.com/papijou2433/…
gsuckz Jan 26, 2024
2e617a3
cambios
gsuckz Jan 26, 2024
a12bea2
Cambios
gsuckz Feb 1, 2024
8b10df6
CDAC2
gsuckz Feb 2, 2024
1c8ced5
CDAC2 correcciones
gsuckz Feb 2, 2024
cd186e6
Cambios con Mario
gsuckz Feb 4, 2024
7b19d54
cambios
gsuckz Feb 4, 2024
1c224a5
Probar diferentes valores DC
gsuckz Feb 4, 2024
d8990fd
Corregir dimensiones de buff/inv
gsuckz Feb 4, 2024
214bd95
cambios
gsuckz Feb 7, 2024
8e80782
Agregados logic_tb
gsuckz Feb 17, 2024
d381907
Falta logic.spice
gsuckz Feb 17, 2024
daf7359
Update SAR Logic
Feb 18, 2024
eb9ece6
camibios
gsuckz Feb 18, 2024
7c6c67b
Fix SAR Logic sample
Feb 18, 2024
036952d
Merge branch 'papijou2433-patch-1' of https://github.com/papijou2433/…
gsuckz Feb 18, 2024
97c155a
cambios
gsuckz Feb 18, 2024
1f5592c
Fix timing issue with current bit counting
Feb 18, 2024
490055e
Fix timing issue with current bit counting
Feb 18, 2024
21e4554
Cambios con Mario
gsuckz Feb 18, 2024
02bc2b5
Update RTL
Feb 21, 2024
a48c1d3
Merge branch 'papijou2433-patch-1' of https://github.com/papijou2433/…
Feb 21, 2024
4793a73
Cambios
gsuckz Mar 21, 2024
ba55e0c
Updated .devcontainer and .json
VicenteOsorio Mar 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// More info: https://containers.dev/implementors/json_reference/
{
"name": "chipathon-devcontainer",
"image": "akilesalreadytaken/chipathon-tools",
"features": {},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-python.black-formatter"
],
"settings": {
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
}
}
}
},
"mounts": [
{
"source": "\\\\wsl.localhost\\${localEnv:WSL_DISTRO}\\tmp\\.X11-unix",
"target": "/tmp/.X11-unix",
"type": "bind"
},
{
"source": "\\\\wsl.localhost\\${localEnv:WSL_DISTRO}\\tmp\\wslg",
"target": "/mnt/wslg",
"type": "bind"
}
],
"containerEnv": {
"DISPLAY": ":0",
"XDG_RUNTIME_DIR": "/mnt/wslg/runtime-dir",
"WAYLAND_DISPLAY": "wayland-0",
"PULSE_SERVER": "unix:/mnt/wslg/PulseServer",
"PDK": "sky130A"
},
"initializeCommand": "powershell -noprofile -nologo -ExecutionPolicy Bypass .devcontainer\\set-wsl-distro.ps1"
}
275 changes: 275 additions & 0 deletions .devcontainer/run.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
param(
[switch] $pull = $false,
[switch] $interactive = $false,
[switch] $silent = $false,
[switch] $attach = $false,
[switch] $download = $false
)

$global:STACK_OPTIONS = [ordered]@{
1 = 'analog-xk'
2 = 'analog-xm'
3 = 'analog-heavy'
4 = 'digital-ator'
5 = 'digital-icarus'
6 = 'digital-heavy'
7 = 'heavy'
8 = "chipathon-tools"
}

$global:SELECTED_STACK='chipathon-tools'
$global:CONTAINER_NAME=$global:SELECTED_STACK
$global:EXECMODE='desktop'
$global:PDK="gf180mcuD"
$global:DIRECTORY=Get-Location | Foreach-Object { $_.Path }
$global:WSL_DISTRO="NO DISTRO"

$global:PARAMS = ""

New-Alias Call Invoke-Expression

function debug($fname, $message) {
Write-Host "[$fname] $message" -ForegroundColor Green
}

function get-ubuntu-distro() {
# Identify if distro has (Predeterminado) or something like that
Invoke-Expression "wsl --list" | ForEach-Object {
if ($_ -match '\)' ) {
$global:WSL_DISTRO=$_.split('(')[0].replace(" ","")
}
}

debug "get-ubuntu-distro" "Linux distribution: $global:WSL_DISTRO"
}

function validate-environment() {
Write-Host "Checking requirements and WSL updates" -ForegroundColor DarkGray

Write-Host ""
Call "wsl --install Ubuntu --no-launch"
Call "wsl --update"
Write-Host ""
}

function select-stack() {
Write-Host "Please select an stack index:"

$STACK_OPTIONS.GetEnumerator() | ForEach-Object {
Write-Host "[$($_.Key)] - $($_.Value)" -ForegroundColor Cyan
}

$response = Read-Host -Prompt "Container stack to initialize [1-$($STACK_OPTIONS.Count)]"
if ($response) {
$global:SELECTED_STACK = $STACK_OPTIONS[$response-1]
}

$response = Read-Host -Prompt "Container instance name [default=$global:CONTAINER_NAME]"
if ($response) {
$global:CONTAINER_NAME = $response
}
}

function select-execmode() {
Write-Host "Please select an execution mode index"
Write-Host '[1] - desktop' -ForegroundColor Cyan
Write-Host '[2] - web' -ForegroundColor Cyan
$response = Read-Host "Execution mode [1-2] [default=$global:EXECMODE]"

if ($response -eq '1') {
$global:EXECMODE = 'desktop'
} elseif ($response -eq '2') {
$global:EXECMODE = 'web'
} else {
Write-Host "Using default mode ($global:EXECMODE)"
}
}

function bind-to-directory() {
$response = Read-Host "Do you want to bind the container home directory into a windows directory? [N/y]"

if ($response -eq 'y') {
$global:DIRECTORY = Read-Host "Write the windows directory destination , for example `"C:\Users\Username\Desktop\ExampleFolder`"`n"
}
}

function set-aditional-parameters() {
$response = Read-Host -Prompt "Do you want to set additional arguments for the container instantiation? [N/y]"

if ($response -eq 'y') {
$response = Read-Host -Prompt "Write the additional arguments, for example -v <wsl_path>:<container_path>."
$global:PARAMS += " $response"
}
}

function force-pull() {
$response = Read-Host -Prompt "Do you want to pull latest image? [N/y] [default=N]"

if ($response -eq 'y') {
$global:PARAMS += " --pull always"
}
}

function select-pdk() {
Write-Host "Please select a pdk"
Write-Host '[1] - gf180mcuC' -ForegroundColor Cyan
Write-Host '[2] - sky130A' -ForegroundColor Cyan
$response = Read-Host "Execution mode [1-2] [default=$global:PDK]"

if ($response -eq '1') {
$global:PDK = 'gf180mcuC'
} elseif ($response -eq '2') {
$global:PDK = 'sky130A'
} else {
Write-Host "Using default pdk ($global:PDK)"
}
}

function attach-shell () {
Call "docker exec -it $global:CONTAINER_NAME bash"
}

function path-conversion() {
$directory, $other = $args
$drive, $path = $directory.split(":")

echo "/mnt/$($drive.tolower())$($path.replace("\","/"))"
}

function get-value-from-wsl() {
$variable, $other = $args

$cmd = "wsl bash -c `'echo `$$variable`'"

# Simple replacement
#$cmd = "wsl -d $global:WSL_DISTRO bash -c `'echo `$$variable`'"
#$cmd = "wsl -d `'$global:WSL_DISTRO`' bash -c `'echo `$$variable`'"

# Using parenthesis
#$cmd = "wsl -d $($global:WSL_DISTRO) bash -c `'echo `$$variable`'"
#$cmd = "wsl -d `'$($global:WSL_DISTRO)`' bash -c `'echo `$$variable`'"
#$cmd = "wsl -d `"$($global:WSL_DISTRO)`" bash -c `'echo `$$variable`'"

# Using curly braces
#$cmd = "wsl -d ${global:WSL_DISTRO} bash -c `'echo `$$variable`'"
#$cmd = "wsl -d '${global:WSL_DISTRO}' bash -c `'echo `$$variable`'"

# Using here strings (Never worked)
# @"
# "wsl -d $global:WSL_DISTRO bash -c `'echo `$$variable`'"
# "@

debug "get-value-from-wsl" "Command: $cmd"

$response = Invoke-Expression "$cmd"
debug "get-value-from-wsl" "Response: $response"
return $response
}

function set-common-parameters () {
$global:IMAGE = "akilesalreadytaken/chipathon-tools"

if ($attach) {
$global:PARAMS += " -it --rm"
$global:COMMAND = "bash"
} else {
$global:PARAMS += " -d"
$global:COMMAND = ""
}

if ($pull) {
$global:PARAMS += " --pull always"
}

$global:PARAMS += " --name $global:CONTAINER_NAME"
$global:PARAMS += " --security-opt seccomp=unconfined"

# $global:PARAMS += " -p '8888:8888'"
# $global:PARAMS += " -p '8082:8082'"

$global:PARAMS += " -e PDK=$global:PDK"

$global:PARAMS += " -e DISPLAY=$(get-value-from-wsl "DISPLAY")"
$global:PARAMS += " -e WAYLAND_DISPLAY=$(get-value-from-wsl "WAYLAND_DISPLAY")"
$global:PARAMS += " -e XDG_RUNTIME_DIR=$(get-value-from-wsl "XDG_RUNTIME_DIR")"
}

function run-docker-wsl() {
$global:DIRECTORY = path-conversion $global:DIRECTORY

$global:PARAMS += " -v /tmp/.X11-unix:/tmp/.X11-unix"
$global:PARAMS += " -v /mnt/wslg:/mnt/wsl"
$global:PARAMS += " -v ${global:DIRECTORY}:/home/designer/shared "

#Call "wsl -d $global:WSL_DISTRO bash --noprofile --norc -ic `"docker run $global:PARAMS $global:IMAGE $global:COMMAND`""
Call "wsl bash --noprofile --norc -ic `"docker run $global:PARAMS $global:IMAGE $global:COMMAND`""

if ($?) {
Write-Host "Container created successfully!" -ForegroundColor Green
Write-Host "Enter the container with `"docker exec -it $global:CONTAINER_NAME bash`"" -ForegroundColor DarkGray

attach-shell
} else {
Write-Host "Container creation failed, see logs above" -ForegroundColor Red
}
}

function run-docker-win() {
$global:PARAMS += " -v '\\wsl.localhost\$global:WSL_DISTRO\mnt\wslg:/tmp'"
$global:PARAMS += " -v ${global:DIRECTORY}:/home/designer/shared"
#$global:PARAMS += " -v '\\wsl.localhost\$global:WSL_DISTRO\mnt\wslg\runtime-dir'%XDG_RUNTIME_DIR%"

Call "docker run $global:PARAMS $global:IMAGE $global:COMMAND"

if ($?) {
Write-Host "Container created successfully!" -ForegroundColor Green
Write-Host "Enter the container with `"docker exec -it $global:CONTAINER_NAME bash`"" -ForegroundColor DarkGray

attach-shell
} else {
Write-Host "Container creation failed, see logs above" -ForegroundColor Red
}
}

function download-run-bat () {
if (!$download) { return }

try {
$response = Call "Invoke-WebRequest -URI https://git.1159.cl/Mario1159/osic-stacks/raw/branch/main/run.ps1 -OutFile run.ps1"
} catch {
$StatusCode = $_.Exception.Response.StatusCode.value__
Write-Host "Error downloading file :( ($($StatusCode))" -ForegroundColor Red
return
}

Write-Host "run.bat updated successfully" -ForegroundColor Green
}

function run(){
if ($silent) {
Write-Host "[Silent Mode]" -ForegroundColor Yellow
Remove-Alias Call
New-Alias Call Write-Host
}

Write-Host "OSIC-Stacks Container Creation" -ForegroundColor Green

download-run-bat
validate-environment
get-ubuntu-distro

if ($interactive) {
select-stack
select-execmode
bind-to-directory
set-aditional-parameters
force-pull
}

set-common-parameters

#run-docker-win
run-docker-wsl
}

run
26 changes: 26 additions & 0 deletions .devcontainer/set-wsl-distro-2.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
$global:WSL_DISTRO="NO DISTRO"


function debug($fname, $message) {
Write-Host "[$fname] $message" -ForegroundColor Green
}

function get-ubuntu-distro() {
# Identify if distro has (Predeterminado) or something like that
Invoke-Expression "wsl --list" | ForEach-Object {
if ($_ -match '\)' ) {
$global:WSL_DISTRO=$_.split('(')[0].replace(" ","")
}
}

debug "get-ubuntu-distro" "Linux distribution: $global:WSL_DISTRO"


#debug "get-ubuntu-distro" "Stored variable: $([System.Environment]::GetEnvironmentVariable('WSL_DISTRO', 'User'))"
}


get-ubuntu-distro

[Environment]::SetEnvironmentVariable("WSL_DISTRO", $global:WSL_DISTRO, "User")
#[Environment]::SetEnvironmentVariable("WSL_DISTRO", "$global:WSL_DISTRO", "Machine")
30 changes: 30 additions & 0 deletions .devcontainer/set-wsl-distro-3.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function debug($fname, $message) {
Write-Host "[$fname] $message" -ForegroundColor Green
}


function get-ubuntu-distro() {
# Identify if distro has (Predeterminado) or something like that
Invoke-Expression "wsl --list" | ForEach-Object {
if ($_ -match '\)' ) {
$distro=$_.split('(')[0].replace(" ","")

debug 'get-ubuntu-distro' $_
debug 'get-ubuntu-distro' $distro

Out-String -InputObject $distro
}
}
}

[Environment]::SetEnvironmentVariable("WSL_DISTRO", $null, "User")

$WSL_DISTRO='Ubuntu-22.05'
$WSL_DISTRO=get-ubuntu-distro

debug 'main' $(Out-String -InputObject $WSL_DISTRO)

[Environment]::SetEnvironmentVariable("WSL_DISTRO", $WSL_DISTRO, "User")

#[Environment]::SetEnvironmentVariable("WSL_DISTRO", $global:WSL_DISTRO, "User")
#[Environment]::SetEnvironmentVariable("WSL_DISTRO", $global:WSL_DISTRO, "Machine")
16 changes: 16 additions & 0 deletions .devcontainer/set-wsl-distro.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

$WSL_DISTRO='Ubuntu'

function get-ubuntu-distro() {
# Identify if distro has (Predeterminado) or something like that
Invoke-Expression "wsl --list" | ForEach-Object {
if ($_ -match '\)' ) {
$WSL_DISTRO=$_.split('(')[0].replace(" ","")
}
}
}

get-ubuntu-distro

[Environment]::SetEnvironmentVariable("WSL_DISTRO", "$WSL_DISTRO", "User")
#[Environment]::SetEnvironmentVariable("WSL_DISTRO", "$WSL_DISTRO", "Machine")
Loading