open-index/open-npm huggingface dataset:
npm package: @specs-feup/clava-visualization
Description: Clava implementation of the LARA package for visualization of the mapping between source code and AST
Author: Bruno Oliveira
Latest version: 1.0.5

# Clava Visualization Tool

Clava integration of LARA's web tool for visualization and analysis of the AST and its source code.

For more details, see the [LARA Framework repository](https://github.com/specs-feup/lara-framework).

## Usage

Before using the tool, you must include the respective NPM package to your project:

```bash
npm install @specs-feup/clava-visualization
```

To launch or update the visualization tool, execute the following statements in your script:

```js
import VisualizationTool from "@specs-feup/clava-visualization/api/VisualizationTool.js";

await VisualizationTool.visualize();
```

Once ready, Clava will provide the URL that should be opened in the browser to access the web interface. The function can also change the AST root and URL domain and port.

Other properties will allow the user to know other important information from the server:

```js
VisualizationTool.isLaunched;  // true if the server is running
VisualizationTool.url;         // URL where the server is running
VisualizationTool.port;        // port to which the server is listening
VisualizationTool.hostname;    // hostname to which the server is listening
```

For more details, refer to the `GenericVisualizationTool` documentation, from [LARA](https://github.com/specs-feup/lara-framework).
npm package: @specs-feup/clava-vitis-integration
Description: A Clava extension to interact with AMD/Xilinx's Vitis 
Author: Tiago Lascasas Santos
Latest version: 1.0.0

# clava-vitis-integration

An extension of the [Clava C/C++ source-to-source compiler](https://github.com/specs-feup/clava) to programatically synthesize functions obtained from the AST using Vitis HLS

## How to install

This package is [available on NPM](https://www.npmjs.com/package/@specs-feup/clava-vitis-integration). Assuming you already have a [Clava-based NPM project](https://github.com/specs-feup/clava-project-template) setup, you can install the latest stable release with:

```bash
npm install @specs-feup/clava-vitis-integration@latest
```

If you want to use unstable and experimental features, use the `staging` or `nightly` tags instead, as they are both built using the most recent commit in the repository. Nightly builds are built automatically every day, while staging builds are built on-demand:

```bash
npm install @specs-feup/clava-vitis-integration@nightly
```

# Basic usage

To synthesize a function and obtain the synthesis report, you can do something like:

```TypeScript
import Query from "@specs-feup/lara/api/weaver/Query.js";
import { FileJp } from "@specs-feup/clava/api/Joinpoints.js";
import { AmdPlatform, ClockUnit, OutputFormat, UncertaintyUnit, VitisHlsConfig } from "@specs-feup/clava-vitis-integration/VitisHlsConfig";
import { VitisHls } from "@specs-feup/clava-vitis-integration/VitisHls";

const vitis = new VitisHls();

const config = new VitisHlsConfig("rgbToGrayscale")
    .setClock({ value: 100, unit: ClockUnit.MEGAHERTZ })
    .setUncertainty({ value: 2, unit: UncertaintyUnit.NANOSECOND })
    .setPlatform(AmdPlatform.ZCU102)
    .setOutputFormat(OutputFormat.VITIS_XO);
vitis.setConfig(config);

// RTL synthesis (report with resource usage estimations)
const synReport = vitis.synthesize();
console.log(synReport);

// Place and route (report with actual resource usage)
const placeRouteReport = vitis.implement();
console.log(placeRouteReport);
```
npm package: @specs-feup/flow
Description: Control-flow, Data-flow, static-call, and other graphs for Lara.
Author: Pedro Gonçalo Correia
Latest version: 1.0.5

# flow

The primary purpose of this library is control-flow, data-flow, static-call, and other graphs for [lara](https://github.com/specs-feup/lara-framework). As it does not actually depend on lara, it can also be used simply as a cytoscape abstraction for other graph purposes with increased type safety and structure.

## Guides and documentation

- For beginners, the [tutorial slides](https://docs.google.com/presentation/d/12MFa4gRFgww5UEhwkhwruNa6gSwKDVUk7iUVO5qNzwc/edit?usp=sharing) can be a good starting point, as it introduces the main capabilities and concepts of the library, with simple and intuitive examples of how to use it.
- For a more thorough description, check out the [documentation page](https://specs-feup.github.io/modules/_specs_feup_flow.html).

## Development setup

To start development on an unpublished version, create a new folder with the following package.json:

```json
{
    "name": "my-workspace",
    "type": "module",
    "workspaces": [
        "flow"
    ]
}
```

Then, inside the folder, run the following commands:

```sh
git clone https://github.com/specs-feup/flow
npm i
npm run -w flow build
npm i
```

Now flow is installed in this workspace and can be imported as a module. You can add your own package(s) to the workspaces array to develop them alongside flow. Make sure that these packages have flow as a dependency in their package.json.
npm package: @specs-feup/hoopa
Description: A suite of heuristic, single-pass algorithms for partitioning and optimizing a C/C++ application on a CPU-FPGA system
Author: Tiago Lascasas Santos
Latest version: 0.7.1

# hoopa

Hoopa (**Ho**listic **o**ptimization and **p**artitioning **a**lgorithms) is an extension to the [Clava C/C++ to C/C++ source-to-source compiler](https://github.com/specs-feup/clava) that takes in any C/C++ application and finds code regions suitable for FPGA offloading. Besides providing basic partitioning algorithms, Hoopa also proposes and implements a novel algorithm that selects a region by considering both the partitioning decisions (e.g., CPU-FPGA communication costs, FPGA resources) and the optimizations performed over the FPGA code (e.g., streaming, pipelining).

## How to install

This package is [available on NPM](https://www.npmjs.com/package/@specs-feup/hoopa). Assuming you already have a [Clava-based NPM project](https://github.com/specs-feup/clava-project-template) setup, you can install the latest stable release with:

```bash
npm install @specs-feup/hoopa@latest
```

If you want to use unstable and experimental features, use the `staging` or `nightly` tags instead, as they are both built using the most recent commit in the repository. Nightly builds are built automatically every day, while staging builds are built on-demand:

```bash
npm install @specs-feup/hoopa@nightly
```

## Partitoning algorithms

Hoopa is still in very early development, and so far we only provide two basic policies:

### Offloading user-defined tasks

```TypeScript
const config = new HoopaConfig()
    .addBackend(OffloadingBackend.XRT)
    .addAlgorithm(HoopaAlgorithm.PREDEFINED_TASKS, {
        taskNames: ["convolve2d_rep2", "combthreshold"]
    } as PredefinedTasksOptions)
    .addBuiltinFpgaTarget(BuiltinFpgaTarget.ZCU102);

const hoopa = new HoopaAPI("edge_detect", config, "outputs/local", "edgedetect");
hoopa.runFromStart(false);
```

### Offloading the task with the highest latency, as determined by Vitis

```TypeScript
const config = new HoopaConfig()
    .addDecorator(TaskGraphDecorator.VITIS_HLS)
    .addBackend(OffloadingBackend.XRT)
    .addAlgorithm(HoopaAlgorithm.SINGLE_HOTSPOT, {} as SingleHotspotTaskOptions)
    .addBuiltinFpgaTarget(BuiltinFpgaTarget.ZCU102);

const hoopa = new HoopaAPI("edge_detect", config, "outputs/local", "edgedetect");
hoopa.runFromStart(false);
```
npm package: @specs-feup/lara-visualization
Description: LARA package for visualization of the mapping between source code and AST
Author: Bruno Oliveira
Latest version: 1.1.0

# LARA Visualization Tool

Web tool for visualization and analysis of the AST and its source code.

For more details, see the [LARA Framework repository](https://github.com/specs-feup/lara-framework).

## Integration

Internally, the tool follows a system for interaction with the compiler, to be able to apply code linkage and correction, among others, while still being independent of the specific compiler. This system is an implementation of the Factory Method pattern, and the [integration with Clava](https://github.com/specs-feup/clava-visualization) is illustrated in the following diagram:

![Compiler Abstracted System](./compiler-abstracted-system.svg)

To integrate the tool in another compiler:

1. Implement the `GenericAstConverter` interface, with its functions properly implemented. More information can be found in their documentation.
2. Create a class that extends `GenericVisualizationTool`, and override `getAstConverter` so that it returns an instance of the class declared in the previous step.
3. Use an instance of the previous class as the entry point of the visualization tool API, for the compiler in question.

## Usage

The tool is best suited to be extended as a new NPM package. For integration, create a new NPM project and include LARA Visualization Tool's package.

```bash
npm install @specs-feup/lara-visualization
```

From there, make all adjustments necessary to use the tool for your compiler in that package, and include it in the project where your LARA scripts are found.

After integration, and being `VisualizationTool` the extended derived class of `GenericVisualizationTool`, to launch or update the visualization tool, execute the following statement:

```js
await VisualizationTool.visualize();
```

Once ready, the tool will provide the URL that should be opened in the browser to access the web interface. The function can also change the AST root and URL domain and port.

Other properties will allow the user to know other important information from the server:

```js
VisualizationTool.isLaunched;  // true if the server is running
VisualizationTool.url;         // URL where the server is running
VisualizationTool.port;        // port to which the server is listening
VisualizationTool.hostname;    // hostname to which the server is listening
```

For more details, refer to the `GenericVisualizationTool` documentation. 

For a more detailed example on the usage of this project, check the [Clava visualization tool repository](https://github.com/specs-feup/clava-visualization).