Skip to content

Commit

Permalink
update docs and remove fw APIs files
Browse files Browse the repository at this point in the history
  • Loading branch information
NouranAbdelaziz committed Jan 21, 2025
1 parent b8ebd7c commit bc654aa
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 119 deletions.
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The WDT can be enabled/disabled. When it is disabled the counter is loaded with

APB, AHBL, and Wishbone wrappers are provided. All wrappers provide the same programmer's interface as outlined in the following sections.

#### Wrapped IP System Integration
### Wrapped IP System Integration

Based on your use case, use one of the provided wrappers or create a wrapper for your system bus type. For an example of how to integrate the wishbone wrapper:
```verilog
Expand All @@ -31,12 +31,14 @@ EF_WDT32_WB INST (
.IRQ(irq),
);
```
#### Wrappers with DFT support
### Wrappers with DFT support
Wrappers in the directory ``/hdl/rtl/bus_wrappers/DFT`` have an extra input port ``sc_testmode`` to disable the clock gate whenever the scan chain testmode is enabled.
### Interrupt Request Line (irq)
This IP generates interrupts on specific events, which are described in the [Interrupt Flags](#interrupt-flags) section bellow. The IRQ port should be connected to the system interrupt controller.

## Implementation example

The following table is the result for implementing the EF_WDT32 IP with different wrappers using Sky130 PDK and [OpenLane2](https://github.com/efabless/openlane2) flow.
The following table is the result for implementing the EF_WDT32 IP with different wrappers using Sky130 HD library and [OpenLane2](https://github.com/efabless/openlane2) flow.
|Module | Number of cells | Max. freq |
|---|---|---|
|EF_WDT32|TBD| TBD |
Expand Down Expand Up @@ -89,13 +91,13 @@ Writing 0 disables the WDT and writing 1 enables it
The wrapped IP provides four registers to deal with interrupts: IM, RIS, MIS and IC. These registers exist for all wrapper types.

Each register has a group of bits for the interrupt sources/flags.
- `IM` [offset: 0xff00]: is used to enable/disable interrupt sources.
- `IM` [offset: ``0xff00``]: is used to enable/disable interrupt sources.

- `RIS` [offset: 0xff08]: has the current interrupt status (interrupt flags) whether they are enabled or disabled.
- `RIS` [offset: ``0xff08``]: has the current interrupt status (interrupt flags) whether they are enabled or disabled.

- `MIS` [offset: 0xff04]: is the result of masking (ANDing) RIS by IM.
- `MIS` [offset: ``0xff04``]: is the result of masking (ANDing) RIS by IM.

- `IC` [offset: 0xff0c]: is used to clear an interrupt flag.
- `IC` [offset: ``0xff0c``]: is used to clear an interrupt flag.


The following are the bit definitions for the interrupt registers:
Expand All @@ -111,8 +113,24 @@ The IP includes a clock gating feature that allows selective activation and deac
VERILOG_DEFINES:
- CLKG_SKY130_HD
```
## Firmware Drivers:
Firmware drivers for EF_WDT32 can be found in the [EF_WDT32](https://github.com/efabless/EF_APIs_HUB/tree/main/EF_WDT32) directory in the [EF_APIs_HUB](https://github.com/efabless/EF_APIs_HUB) repo. EF_WDT32 driver documentation is available [here](https://github.com/efabless/EF_APIs_HUB/tree/main/EF_WDT32/README.md).
You can also find an example C application using the EF_WDT32 drivers [here](https://github.com/efabless/EF_APIs_HUB/tree/main/EF_WDT32/EF_WDT32_example.c).
## Installation:
You can install the IP either by cloning this repository or by using [IPM](https://github.com/efabless/IPM).
### 1. Using [IPM](https://github.com/efabless/IPM):
- [Optional] If you do not have IPM installed, follow the installation guide [here](https://github.com/efabless/IPM/blob/main/README.md)
- After installing IPM, execute the following command ```ipm install EF_WDT32```.
> **Note:** This method is recommended as it automatically installs [EF_IP_UTIL](https://github.com/efabless/EF_IP_UTIL.git) as a dependency.
### 2. Cloning this repo:
- Clone [EF_IP_UTIL](https://github.com/efabless/EF_IP_UTIL.git) repository, which includes the required modules from the common modules library, [ef_util_lib.v](https://github.com/efabless/EF_IP_UTIL/blob/main/hdl/ef_util_lib.v).
```git clone https://github.com/efabless/EF_IP_UTIL.git```
- Clone the IP repository
```git clone https://github.com/efabless/EF_WDT32```

### The Wrapped IP Interface

### The Interface
>**_NOTE:_** This section is intended for advanced users who wish to gain more information about the interface of the wrapped IP, in case they want to create their own wrappers.
<img src="docs/_static/EF_WDT32.svg" width="600"/>

Expand All @@ -124,17 +142,3 @@ VERILOG_DEFINES:
|WDTLOAD|input|32|The value loaded into the timer when it reaches zero|
|WDTTO|output|1|Time out flag|
|WDTEN|input|1|watchdog timer enable|
## Firmware Drivers:
Firmware drivers for EF_WDT32 can be found in the [fw](https://github.com/efabless/EF_WDT32/tree/main/fw) directory. EF_WDT32 driver documentation is available [here](https://github.com/efabless/EF_WDT32/blob/main/fw/README.md).
You can also find an example C application using the EF_WDT32 drivers [here]().
## Installation:
You can install the IP either by cloning this repository or by using [IPM](https://github.com/efabless/IPM).
##### 1. Using [IPM](https://github.com/efabless/IPM):
- [Optional] If you do not have IPM installed, follow the installation guide [here](https://github.com/efabless/IPM/blob/main/README.md)
- After installing IPM, execute the following command ```ipm install EF_WDT32```.
> **Note:** This method is recommended as it automatically installs [EF_IP_UTIL](https://github.com/efabless/EF_IP_UTIL.git) as a dependency.
##### 2. Cloning this repo:
- Clone [EF_IP_UTIL](https://github.com/efabless/EF_IP_UTIL.git) repository, which includes the required modules from the common modules library, [ef_util_lib.v](https://github.com/efabless/EF_IP_UTIL/blob/main/hdl/ef_util_lib.v).
```git clone https://github.com/efabless/EF_IP_UTIL.git```
- Clone the IP repository
```git clone https://github.com/efabless/EF_WDT32```
55 changes: 0 additions & 55 deletions fw/EF_WDT32.c

This file was deleted.

25 changes: 0 additions & 25 deletions fw/EF_WDT32.h

This file was deleted.

59 changes: 54 additions & 5 deletions fw/EF_WDT32_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -20,16 +20,44 @@
#ifndef EF_WDT32REGS_H
#define EF_WDT32REGS_H


/******************************************************************************
* Includes
******************************************************************************/
#include <stdint.h>

/******************************************************************************
* Macros and Constants
******************************************************************************/

#ifndef IO_TYPES
#define IO_TYPES
#define __R volatile const unsigned int
#define __W volatile unsigned int
#define __RW volatile unsigned int
#define __R volatile const uint32_t
#define __W volatile uint32_t
#define __RW volatile uint32_t
#endif

#define EF_WDT32_TIMER_REG_TIMER_BIT ((uint32_t)0)
#define EF_WDT32_TIMER_REG_TIMER_MASK ((uint32_t)0xffffffff)
#define EF_WDT32_TIMER_REG_MAX_VALUE ((uint32_t)0xFFFFFFFF)

#define EF_WDT32_LOAD_REG_LOAD_BIT ((uint32_t)0)
#define EF_WDT32_LOAD_REG_LOAD_MASK ((uint32_t)0xffffffff)
#define EF_WDT32_LOAD_REG_MAX_VALUE ((uint32_t)0xFFFFFFFF)

#define EF_WDT32_CONTROL_REG_CONTROL_BIT ((uint32_t)0)
#define EF_WDT32_CONTROL_REG_CONTROL_MASK ((uint32_t)0x1)
#define EF_WDT32_CONTROL_REG_MAX_VALUE ((uint32_t)0x1)

#define EF_WDT32_WDTTO_FLAG 0x1

#define EF_WDT32_WDTTO_FLAG ((uint32_t)0x1)



/******************************************************************************
* Typedefs and Enums
******************************************************************************/

typedef struct _EF_WDT32_TYPE_ {
__R timer;
__W load;
Expand All @@ -42,5 +70,26 @@ typedef struct _EF_WDT32_TYPE_ {
__W GCLK;
} EF_WDT32_TYPE;

typedef struct _EF_WDT32_TYPE_ *EF_WDT32_TYPE_PTR; // Pointer to the register structure


/******************************************************************************
* Function Prototypes
******************************************************************************/



/******************************************************************************
* External Variables
******************************************************************************/




#endif

/******************************************************************************
* End of File
******************************************************************************/


2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/EF_WDT32_AHBL.dev.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/EF_WDT32_AHBL.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/EF_WDT32_APB.dev.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/EF_WDT32_APB.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/EF_WDT32_WB.dev.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/EF_WDT32_WB.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/dft/EF_WDT32_AHBL_DFT.dev.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/dft/EF_WDT32_AHBL_DFT.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/dft/EF_WDT32_APB_DFT.dev.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/dft/EF_WDT32_APB_DFT.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/dft/EF_WDT32_WB_DFT.dev.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
2 changes: 1 addition & 1 deletion hdl/rtl/bus_wrappers/dft/EF_WDT32_WB_DFT.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand Down
Loading

0 comments on commit bc654aa

Please sign in to comment.