Skip to content

Commit 1928e0a

Browse files
authored
Merge branch 'main' into solver-improvements
2 parents 1198a31 + eb1245b commit 1928e0a

File tree

15 files changed

+45
-40
lines changed

15 files changed

+45
-40
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: ci
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
94
env:
105
CARGO_TERM_COLOR: always
116

README.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Argon
22

3-
[![ci](https://github.com/ucb-substrate/argon/actions/workflows/ci.yml/badge.svg)](https://github.com/ucb-substrate/argon/actions/workflows/ci.yml)
43
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
54

65
Argon is a programming language for writing constraint-based integrated circuit layout generators.
@@ -34,7 +33,7 @@ Future versions of Argon will hopefully support:
3433

3534
To use Argon, you will need:
3635
- [Rust (tested on 1.90.0)](https://www.rust-lang.org/tools/install)
37-
- One of [Neovim](https://github.com/neovim/neovim/blob/master/INSTALL.md) or [VS Code](https://code.visualstudio.com/download)
36+
- One of [Neovim (version 0.11.0 or above)](https://github.com/neovim/neovim/blob/master/INSTALL.md) or [VS Code (version 1.100.0 or above)](https://code.visualstudio.com/download)
3837

3938
Begin by cloning and compiling the Argon source code:
4039

@@ -81,6 +80,15 @@ Add the following key:
8180
}
8281
```
8382

83+
Compile the VS Code extension by running the following from the root directory of your Argon clone:
84+
85+
```bash
86+
cd plugins/vscode
87+
npm install
88+
npm run compile
89+
cd ../..
90+
```
91+
8492
To open an example Argon workspace, run the following from the root directory of your Argon clone:
8593

8694
```bash
@@ -91,11 +99,19 @@ We recommend defining an alias in your shell configuration to simplify future co
9199

92100
```bash
93101
alias codear="code --extensionDevelopmentPath=<absolute_path_to_argon_repo>/plugins/vscode"
102+
```
103+
104+
With this alias defined, you can now run:
105+
106+
```bash
94107
codear core/compiler/examples/argon_workspace
95108
```
96109

97110
Open the `lib.ar` file within the workspace. You can then start the GUI by running Command Palette > Argon LSP: Start GUI.
98111

112+
> [!WARNING]
113+
> If you cannot find the command for starting the GUI but did not notice any obvious errors, you may be on an old version of VS Code.
114+
99115
From within the GUI, type `:openCell test()` to open the `test` cell. You should now be able to edit layouts
100116
in both VS Code and the GUI.
101117

@@ -133,10 +149,11 @@ Hit `d` to use the Dimension tool and click on the top edge of each rectangle. C
133149
The dimension should now be highlighted yellow, indicating that you are editing that dimension. Type `5.` and hit enter to set the value
134150
of the dimension (the decimal point is important, since just `5` is considered an integer literal rather than a float).
135151

136-
Double check that there are no errors in your code editor, or the GUI will not be able to
137-
display the updated cell. If you make a mistake,
138-
you can undo and redo changes from the GUI using `u` and `Ctrl + r`,
139-
respectively, or manually modify the code in the text editor if needed.
152+
> [!WARNING]
153+
> Double check that there are no errors in your code editor, or the GUI will not be able to
154+
> display the updated cell. If you make a mistake,
155+
> you can undo and redo changes from the GUI using `u` and `Ctrl + r`,
156+
> respectively, or manually modify the code in the text editor if needed.
140157
141158
Repeat for the other 3 sides of the rectangle.
142159

-8.85 KB
Binary file not shown.

core/compiler/examples/sky130_inverter/lib.ar

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cell inverter(nw: Float, pw: Float) {
2-
let ndiff = rect("diff.drawing", x0=0., y0=0., y1=nw + nw);
2+
let ndiff = rect("diff.drawing", x0=0., y0=0., y1=nw);
33
let poly = rect("poly.drawing", y0=ndiff.y0-130.);
44
eq(poly.x0 + poly.x1, ndiff.x0 + ndiff.x1);
55
eq(poly.x1 - poly.x0, 150.);
@@ -55,7 +55,7 @@ cell inverter(nw: Float, pw: Float) {
5555

5656
let nwell = rect("nwell.drawing", x0=ntap.x0-180., x1=ntap.x1+180., y0=pdiff.y0-180., y1=ntap.y1+180.);
5757

58-
let licon = rect("licon1.drawing", x0=0., x1=170., y0=0., y1=170.);
58+
let licon = crect(layer="licon1.drawing", x0=0., x1=170., y0=0., y1=170.);
5959
let cons = crect(x0=vdd_s.x0, x1=vdd_s.x1, y0=pdiff.y0+40., y1=pdiff.y1-40.);
6060
#scope1 std::center_rects(cons, #scope0 std::max_array(licon, cons.w, cons.h, 340., 340.));
6161
let cons = crect(x0=vout.x0, x1=vout.x1, y0=pdiff.y0+40., y1=pdiff.y1-40.);

core/compiler/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ mod tests {
473473
})
474474
.collect::<IndexMap<_, _>>();
475475
for rect in cell.objects.iter().filter_map(|obj| obj.1.get_rect()) {
476+
if rect.construction {
477+
continue;
478+
}
476479
if let Some(layer) = &rect.layer {
477480
let (layer, datatype) = layers[&layer.as_str()];
478481
let x0 = rect.x0.0 as i32;

core/gui/src/editor/canvas.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,6 @@ impl LayoutCanvas {
14981498
} else {
14991499
true
15001500
};
1501-
// TODO: add dimension constraint to code here instead of in input.rs
15021501
let state = self.state.read(cx);
15031502

15041503
if enter_entry_mode && let Some(cell) = state.solved_cell.read(cx) {
@@ -1724,7 +1723,6 @@ impl LayoutCanvas {
17241723
}
17251724
}
17261725

1727-
#[allow(dead_code)]
17281726
fn layout_to_px(&self, pt: Point<f32>) -> Point<Pixels> {
17291727
Point::new(self.scale * Pixels(pt.x), self.scale * Pixels(-pt.y))
17301728
+ self.offset
@@ -1842,7 +1840,6 @@ impl LayoutCanvas {
18421840
});
18431841
}
18441842

1845-
#[allow(unused)]
18461843
pub(crate) fn on_mouse_down(
18471844
&mut self,
18481845
event: &MouseDownEvent,
@@ -1867,7 +1864,6 @@ impl LayoutCanvas {
18671864
cx.notify();
18681865
}
18691866

1870-
#[allow(unused)]
18711867
pub(crate) fn on_drag_move(
18721868
&mut self,
18731869
_event: &DragMoveEvent<()>,
@@ -1877,7 +1873,6 @@ impl LayoutCanvas {
18771873
self.is_dragging = false;
18781874
}
18791875

1880-
#[allow(unused)]
18811876
pub(crate) fn on_mouse_up(
18821877
&mut self,
18831878
_event: &MouseUpEvent,

core/gui/src/editor/toolbars.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ impl Render for LayerSideBar {
178178
.filter(|layer| {
179179
layer
180180
.name
181-
.contains(self.name_filter.read(cx).content.as_ref())
181+
.to_lowercase()
182+
.contains(&self.name_filter.read(cx).content.to_lowercase())
182183
&& (!self.state.read(cx).used_filter || layer.used)
183184
})
184185
.map(|layer| {
@@ -284,7 +285,8 @@ impl HierarchySideBar {
284285
let expanded = self.expanded_scopes.contains(&scope_path);
285286
if scope_state
286287
.name
287-
.contains(self.name_filter.read(cx).content.as_ref())
288+
.to_lowercase()
289+
.contains(&self.name_filter.read(cx).content.to_lowercase())
288290
{
289291
scopes.push(
290292
div()

core/gui/src/rpc.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,16 @@ impl SyncGuiToLspClient {
4949
let (tx, mut rx) = mpsc::channel(1);
5050
let mut listener = self.app.background_executor().block(
5151
async {
52-
tarpc::serde_transport::tcp::listen((Ipv4Addr::LOCALHOST, 0), Json::default)
53-
.await
54-
.unwrap()
52+
if let Ok(listener) =
53+
tarpc::serde_transport::tcp::listen((Ipv4Addr::LOCALHOST, 12346), Json::default)
54+
.await
55+
{
56+
listener
57+
} else {
58+
tarpc::serde_transport::tcp::listen((Ipv4Addr::LOCALHOST, 0), Json::default)
59+
.await
60+
.unwrap()
61+
}
5562
}
5663
.compat(),
5764
);

core/lsp-server/src/document.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ impl Document {
3636
pos2position(self.contents.offset_to_pos(offset).unwrap())
3737
}
3838

39-
#[allow(dead_code)]
4039
pub(crate) fn substr(&self, range: std::ops::Range<Position>) -> &str {
4140
self.contents
4241
.substr(position2pos(range.start)..position2pos(range.end))

core/lsp-server/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ impl StateMut {
105105
}
106106

107107
async fn compile(&mut self, client: &Client, update: bool) {
108-
// TODO: un-hardcode this.
109108
if let Some(root_dir) = &self.root_dir {
110109
self.config = parse_config(root_dir.join("Argon.toml")).ok();
111110
let lyp = self

0 commit comments

Comments
 (0)